Cum is protein --> when proteins get in contact with something warm they coagulate. Look at eggwhite for example --> in contact with a hot pan, they get harder, solid because of coagulating. The same with sperm.