Simplistic to say that it's just for a laugh. It's possible to laugh and admit that, in a sense, it's not funny. There may be a target for the humour - a person, an institution or a set of beliefs - where the underlying purpose is deadly serious. Humour can occur in surprisingly serious contexts, as in sick jokes about death.