Heat cannot transfer energy spontaneously from colder to hotter, because the entropy of the overall system would decrease.
How is it possible for the entropy of a system to decrease? If you pick up marbles that are scattered about the room and put them into a cup, your work has decreased the entropy of that system.
If you gather iron ore from the ground and convert it into steel and build a bridge, your work has decreased the entropy of that system.
In the game of 52 pickup, the prankster tosses an entire deck of playing cards onto the floor, and you get to pick them up.
In the process of picking up the cards, you may have noticed that the amount of work required to restore the cards to an orderly state in the deck is much greater than the amount of work required to toss the cards and create the disorder.