L293D motor shield power sources

If the motor supply is absent or inadequate the L293D internally routes current from the logic supply to
the power side of its circuitry.

Clearly the batteries are failing to provide enough current on their own.

Have you thought to measure the currents and voltages with a multimeter?