Kind of like what @anon57585045 said:
Relays are inductive loads. When you take power off of them, their magnetic field collapses and generates a spike of negative voltage that the Arduino doesn't really like. Upon reset it's fine but I wouldn't keep the system running that way. Use a MOSFET, transistor, or h-bridge to turn on the relay.