In a fictional world with merfolk, the hair could not be a part of their body at all, but some kind of algae or other organism that would look like hair to a human or humanoid observer from another species. The symbiote would simply prefer to attach to the merfolk's head and not other body parts due to one motive or another.
Bonus saddistic points if the symbiotes in question are coelenterata (i.e.: related to jellyfish). That mermaid looks so beautiful and gorgeous, let me fondle her hair... Seriously, though, this would add some level of protection against predators. Think of hermit crabs and anemones. Except the anemone looks like a wig and hermit crab is a half-mammal-half fish-fish creature.