Hi,
i think the most prolem is the wiring, not the PCB.
All the current caused by motor and logic runs through one GND wire. It has an impedance, so every current cuses a voltage drop. Additionally every puls causes an even higher voltage drop.
So either use two seperate GND wires and two seperate 5V wires for Power and Logic respectively.
Or use differential signalling instead of single ended TTL wiring.
A relatively large ceramics capacitor next to motor connections may avoid high frequency components in motor current on PCB and wiring.
It depends on wire length, wire gauge, current value, current frequency....
Klaus