Handshaking may be a chemical as well as a social greeting
economist.com
economist.com
PS: The perfume industry is $28.95 billion worldwide so the idea that people care about how others smell should be obvious. And not just women as men's deodorant is vary common.
I think I have a hypothesis which fits that observation: when we shake hands with someone of the same sex, we want to evaluate that person, and so sniff his scent; when we shake hands with someone of the opposite sex, we are concerned that we're giving the best impression, and thus sniff her scent. We're subconsciously neurotic.
Alternatively, we're not attuned to the pheromones of a member of the same sex, so have to sniff our shaken hand to detect them; meanwhile, we can easily smell those of a member of the opposite sex in the air, and sniff our own scent in order to compare compatibility.
Other theories?
As far as I'm aware, the handshake started as an impromptu dirk-frisk.
We know people did it back in the 4th century BCE, so it's not a stretch to think that it might be a lot older than that. Old enough that it's just something we've always done, with no real idea as to why. So we make up reasons, like to show we are not armed.