Good job on figuring it out
The damaged temp. sensor wasn't able send the engine temp to the ecu... the ecu (not knowing the engine temp) activated the electric cooling fan to "save" the engine from over heating. The ecu had to be reset/code cleared for it to function properly again... Basically what others have said.