That looks like a big solenoid - the flywheeling diode is not optional if you want the rest of the circuit to work
(or even survive).
I suspect the large inductive spikes it was generating were putting large transients on all the wiring nearby (if
you run power+ground as a twisted pair you'll get better immunity to interference BTW, but here the lack of
a diode (or snubber) is crucial.