They definitely fulfil a purpose. Mammals strengthen bonds through mutual grooming (and the little bits of free protein for those who haven't discovered the existence of electrical bug zapping combs and neurotoxin infused shampoos). Those increased bonds led to the eventual evolution of human-like primates and eventually Homo sapiens. Without those intimate bonds formed between relatives, offspring, sexual partners and non related members of groups, it wouldn't have been possible for humanity to get where it is today.
Nits are therefore responsible for everything up to and including Elon Musk and Trump's fake tan.