It seems as if concepts like temperature and the second law of thermodynamics are difficult to apply on the planetary scale. There are a lot of pitfalls, one or two of which probably most of us has fallen into some time. But there is always opportunity to learn from our mistakes. But physics cannot be determined by the human language. Are there any more physical "hands-on" concepts that we can use instead of abstract notions that might lead to confusion?
Imagine that you go to the beach a warm (25 deg C) day with a backpack full of cold beer. You don't want to drink the beer immediately but rather wait a couple of hours until your friends arrive. From experience you know that in the meantime the beer will warm to ambient temperature unless you do something. There are two options: In the bar at the beach there is a refrigerator which you can use. But next to the beach there is also a two kilometer high mountain and a helicopter standing at your disposal. You could if you want take the backpack in the helicopter, fly to the top of the mountain where the temperature is 8 deg C, leave the beer there and then return to pick it up some hours later. Which is more practical? Which is less energy consuming? I think most of us would find the refrigerator more practical, since going up the mountain requires a lot of work against the gravitational field.
Likewise, the gravity field effectively prevents us from constructing a perpetuum mobile from the temperature difference that is beeing maintained for free between the ground and the top of the mountain. So, what do you then think is the cause of this temperature difference?