Apparently, people figure out what social groups they identify with and belong to through a variety of different factors - but almost none more important than humor.
According to social psychologists, humor is a means of establishing your views as similar to those around you.
Just remember, next time someone says something is "just supposed to be funny" - it's a tool to make new friends, and almost by definition, jokes are for certain audiences and for the exclusion of others.
Of course some humor is more likely to do that. But when our society really just comes down to a matter of taste, it's important what we're laughing at.