Why MOSFET switching load effect gate voltage?
There are a few issues with that board, but luckily enough you can cure them rather painless.
1. You really must fit a freewheeling diode across the output posts.
Best location is also the easiest, just solder it on the output terminal strip pins bottomside your pcb.
This will prevent load and load wiring inductance to push your MOSFET into avalanche at every turn-off.
Virtually any diode rated at least twice your supply and pump current would do, 1N4002 for instance or anything you have handy. Contrary to common belief a fast recovery is not really needed for &quot;seldom&quot; on/off switching. It could be useful for PWM driving only.
Avalanche is usually not too bad for the MOSFET itself if energy is below allowed Eas, but in turn may generate high voltage (over 100V)  high dv/dt pulses which can easily be conducted around doing weird things to your Arduino controller.
2. You must replace your IRF520 MOSFET with one suitable do be driven by Arduino 5V output.
IRF520 should be driven at least 10V for reliabily turn on, fit an IRL520 instead.
IRF may sometimes seem to working fine but it will, at best, heat more than what's due. But at worst it may only partially drive your pump and/or work today with your very specimen but not if you try do build a second one another day.
3. Not really a must but would help a lot -and I would definitely do- add some bypass capacitance across power Vcc pins.
Again solder  bottomside just across terminal strip pins, value somehow depends on load but it is not critical, a few microfarads alluminium should do.
This would create a short loop for both on and off transient currents reducing the chance to have noise around in the system and hence weird erratic controller behaviour.
4. Take care of power and controller current flows. (Credits to Kartman)
Try to keep them separated, draw the schematic of Arduino, switching module, load and power supply(ies) keeping in mind that every line you draw is not an ideal wire with zero voltage drop, but a real one with its own resistance and inductance messing up the things when shared by a fast, heavy power current and a tiny control signal.
And now last but not least:
0. Try not to buy poor enginered cheap boards.
We have come to a point where virtually nothing of the original board is left as good.