The ULN2803 is not driving the motor. It is driving the relay that controls the motor. The relay draws only 78mA (12VDC/155ohms).
The diode(s) at the pump is OK. The distance (2m) is good. Note: The relay coil should have its own separate diode.Regarding the relay contacts:How are you switching the pump on ... is 24V power switched to the pump's positive terminal, or is the pump's negative terminal switched to the 24V supply ground?EDIT: Here's an opto isolation circuit I was thinking of ... it would require using a relay with 24VDC coil.
The only relays with enough contact current have 12V coils.
The opto circuit vs the ULN2803 circuit assumes the 12V relay/coil is causing the problem. Otherwise swapping out the ULN2803 for the opto will have no effect.
What I was trying to say is that if I use an opto and a 12V relay there is no difference compared to a ULN2803 and a 12V relay.
It was also suggested that I add some small caps to the 5V and 12V lines where they attach to the arduino as well.
P.S. I'm not sure what the capacitor is supposed to do in your new drawing. It only connects to 24V and never discharges.