Do fans stop spinning when MacBook Pro's are in sleep mode?
Fan function is regulated by temperature sensors.

As long the temperature is to high the fan keeps working regardless if you are in sleep mode or not. Since you turned off the heat source that action is usually very short.

Somewhat like you car fan, that continues to spin even if you turn off the engine if the temperature is to high.