The only spikes looking very bad are from the power supply, the rest looks reasonably OK.
- Any piece of wire is also an inductor, a capacitor and a resistor. All three at the same time. Long wires, or thin wires, can create very nasty spikes with switched loads. How does the +24V waveform looks like when measured at the output of the power supply (before the wires to the soldering station)?
- In the schematic there is no capacitor between +24V and GND. There should be at least 2 of them. One of a few hundreds...thousands uF to act as a local energy "reservoir", and in parallel with the +24V electrolytic another 0.1 uF so the high frequency spikes can find a short path through the 0.1uF without going through the long wires up to the power supply. C1 and C2 you have now does not help if the 24V heater is connected before the D2, as the schematic suggests. Either move the C1 and C2 at the anode side, or simply remove the diode and pay attention to the correct polarity when connecting the circuit to its power supply.
- Maybe you can find a broken PC power supply and recover one of those ferrite tor coils to put it in series with the +24V, right near the solder station.
- The power circuit must have thick connection wires between the power supply, the MOSFET and the soldering iron socket. For example, the 3 multi stranded wires usually found inside 220V/16A power cords (the EU ones made with copper, not cheap Chinese fake 16A - even if they look like copper, if the metal they are made of is attracted by a magnet, that's not good).
- Just to be sure there are no strange ground loops between the PC, the power supply and the oscilloscope, during probing do not connect the Arduino to the PC USB cable, leave the Arduino powered by its own circuit.
- Another thing (we will let this to talk about after fixing the spikes), I suspect that the turn off edge of the MOSFET is not very sharp. The charge accumulated in the GS junction is left to discharge through the 4.7K to ground. If the MOSFET still heats too much, that's where the MOSFET driving circuit can be improved. This is visible in the DS 0429.jpg, where the strong spikes appears only when the MOSFET is turned on, but not when is turned off, suggesting the turn on edge is much faster than the turn off edge. To minimize the power dissipated in the MOSFET, and therefore its temperature, we want fast edges for both on and off switching.