Does anything have an evolutionary "purpose"? I mean really. Why, really, is the human tailbone less "purposeful" than our hair?
Not having a tailbone has probably not been an evolutionary advantage. Hair is an evolutionary advantage, not a big one but bald women don't mate as successfully as women with nice hair do, on average
A trait being seen as attractive in a mate is another way that trait evolves. Hair isn't evolutionary advantageous because it attracts mates, it attracts mates because it is evolutionary advantageous. Sexual selection can get weird and select for things that are fairly far removed from what we might think as utility.
Part of hair's purpose is just as an indicator of health. If you're very unhealthy your hair will fall out or look particularly bad, if it's long and nice looking that means you've probably been healthy for a long time too. That's probably a good indicator at how good you are at taking care of yourself and likewise how good you will be at taking care of your offspring and how good they will be at taking care of themselves.
Sometimes sexual selection is just about how much energy you can spend on doing something to look attractive with no other purpose. Lots of birds exhibit this.