I have a beaglebone black that I tucked inside an rc truck. I removed the radio control chip. Everywhere it had 3.9 volt logic I put in a 3.3v gpio control from the beaglebone. It works great I'm able to control everything from the beaglebone via WiFi. The clencher is I put in a 5v regulator and power to the beaglebone and now whenever I fire the motors Linux begins shutting down, it shuts down safely and while it's shutting down I can still control it until it powers off. I tossed in a diode between ground and positive going into the beaglebone incase it was getting a voltage spike, no success. Now I'm thinking maybe it's a brief voltage drop, however I'm still unable to successfully power the beaglebone and rc car from my own custom made battery. I tried li-ion and ni-mh I went ni-mh because it seemed to do better providing the amperage the rc car needed. Do I need a cap to store energy for possible microsecond lapses in power? If anyone has an idea what's going on please let me know. Also, whatever it is it's not coming over the ground because I can share ground, it's only an issue when I add in the positive for voltage regulation.
It isn't clear from your post if you're powering the motor directly from the BBB GPIO pins. But just so you know, the BBB's GPIOs can source, at most, 1mA. You're almost certainly exceeding this if you're attempting to power any kind of motor. It's right to shut down, it would quickly overheat and destroy itself.
You need a buffer between your GPIO and motor. Connect your GPIO pins to an op amp as an emitter-follower, or a transistor configured as a follower. You'll need another line from your 5V supply to either the op amp or the collector of the transistor.
Even if you are not powering it from the BBB directly, definitely add in a bypass capacitor from 5V to ground, on the order of 10uF or higher. As has been said, the capacitor will compensate for small voltage drops from surge currents. THe drops occur because most regulators are just slow to compensate for fast line changes.