The global climate system is complicated. The Sun is directly overhead near the equator, so it gets very warm here. This heat then circulates to the higher latitudes in weather systems and atmospheric currents. Some of the warm reaches the poles where very little sun reaches the surface. The poles would be very cold, and the equator much hotter if heat wasn’t circulated about in currents. The oceans also helps distribute this heat on much longer time scales.