As people have pointed out when I've hugged them goodbye, I sometimes tend to do it way too hard. It's not exactly uncommon for people to tell me to let go. Usually with words to the effect of, "That hurts." And I usually apologize a little about that. It's usually not my intent to hurt people when I hug them.
I generally only hug family members and friends who request it. I generally minimize physical contact where I can. I wave hello just by holding up my hand after all. Most of my friends refer to it as saying, "How." And a lot of the time, it feels like an obligation with family so I don't really enjoy it that much. If I'm somewhere because it's expected of me and not somewhere I eagerly am, I'd rather just leave without any ceremony.
Most of the time when I hug friends it's completely voluntary. And the past couple of times, I've initiated it. See, told you I wasn't as afraid of touching people as I used to be!
And my reasons for hugging? Pretty much the same as anyone else's, I guess. I'll substitute temporary physical closeness for a perceived lack of emotional bonding. I'll do it because I've missed them. I'll substitute one form of physical closeness for another that's more acceptable. Not everyone will accept a kiss, but most will accept a hug. Most of the time, especially when I hug too hard, it's because I know I will miss them in the time before I get to see them again.