Why does connecting a high-current device to my digital circuit cause weird behavior?
Without details it is impossible to give a specific answer.  Look at these things closely:

Grounding.  This is exactly the symptom you get from a poor overall grounding strategy.  Without a block diagram showing power and grounds of everything connected, it's impossible to give specific advice.  However, carefully visualize all the ground return currents, and consider that any current on a ground conductor will cause a ground offset.

Local decoupling. Make sure there is a 1 &micro;F or so ceramic cap as close as possible between each pair of power and ground pins of each chip.  These connections need to be short, because even a little series inductance significantly reduces their effectiveness.

Power supply surge capability.  Make sure there is enough bulk reservoir capacitance on the power supply to handle transients for whatever time it takes for the power supply itself to catch up and deliver more current.

Inductive catch diodes.  Make really sure that any possible inductive load, which includes any external load, has a reverse polarity diode across it.  For voltages up to 50-100 V or so, these should be Schottky because of their high speed.  This applies to loads driven by DC.  Since they are always driven with one polarity, the diode can safely short out the other polarity.  As Tut pointed out in a comment, for AC loads, more complicated snubber and/or clipping circuits need to be used.