The solenoid is like a spring. (my schematic) If you pull the bottom end down to ground, you have 48 volts across the solenoid. That is like pulling 48 inches across a sprint. Then you open up the MOSFET, it is like letting go of the spring. Both want to shoot up. Something needs to stop the voltage from going very high. (the spring from shooting across the room) The diode will limit the voltage to 48.7 volts. (48+one diode drop)
In the solenoid driver the body diode in the MOSFET never gets used.