Arduino with L293D weird problem

Try adding a separate power supply for the motor Vcc-2, L293-pin-8.
By isolating the motor power and Logic Power you can troubleshoot the problem better.
What are using as a 5V power supply ?