The motor continues to transmit heat to the coolant after switching off, this will pressure the coolant, so the fan continues to run to reduce the coolant temp, also moving air over the motor itself, to be most effective their could be an electric aux pump to circulate the coolant while the fan runs, but it is obviously not necessary.