The human body is a machine and that machine generates heat. In cooler weather that is a good thing. It is a natural way to keep from freezing.
In the summer, when there is no need to generate heat, your body still needs to function and so it still makes heat. Sweat acts as a natural coolant. Using your skin as a type of radiator, your sweat evaporates on your outer skin layer and moves heat out of your body.
Humans are not the only mammals who cool themselves with this type of cooling system. Pigs, horses and primates also sweat, to name a few. They sweat in different ways and in different places depending on their species needs. Just like in humans, when there is a need for more cooling, they sweat more.
Even dogs, who have few sweat glands, use a similar system. They use their tongue to cool their body with the evaporating saliva on their tongue.