Mammals are warm-blooded. Fur insulates the body keeping warmth in. Hairs are also associated with nerves, allowing hair to amplify small amounts of touch sense.
Head hair in humans possibly evolved because hair reflects the quality of an individual's nutrition, health, hormones et al. so runaway sexual selection drove the evolution of long hair and dimorphism of how that hair grows.