C.S. Lewis in “The Screwtape Letters” devoted an entire chapter to laughter, in the form of a letter from the demon Screwtape to his nephew Wormwood on the topic.
Screwtape states in this letter that there are four main things that make people laugh – joy, fun, jokes, and flippancy. Joy and fun, he says, are “disgusting,” incomprehensible to demons like himself, and of very little if any use in getting people to commit sin.
As for jokes, Screwtape says bawdy or salacious humor sometimes proves to be disappointing because people tell such jokes for two reasons: 1) because they are genuinely funny, and 2) because they provide a pretext for talking about sex. Screwtape tells Wormwood that if his “patient” (the person he is trying to tempt) is of the first type, then dirty jokes aren’t going to be of much use in tempting him to serious sin. To some people, Screwtape says, “no passion is as serious as lust,” and a dirty joke doesn’t arouse illicit passions or thoughts precisely because they are too busy laughing at it.
A more promising kind of humor, from Screwtape’s point of view, is the practical joke – which gives people an excuse to do things that would otherwise be considered cruel, humiliating, offensive, cowardly, or dishonest. He says a thousand dirty jokes don’t contribute to a person’s damnation as much as their realizing that they can get away with just about anything as long as they pass it off as a joke.
The “best” kind of humor in terms of leading people away from God, Screwtape says, is flippancy – a clownish attitude that treats everything as a potential joke, treats everyone with irreverence, and takes nothing seriously. This kind of humor, he says, is “a thousand miles away from real joy,” dulls rather than sharpens the intellect, and builds up “the finest armor plating I know against the Enemy (God).”
So based on what Lewis wrote here, I take it that humor and jokes are fine in moderation and even an occasional salacious or profane joke that is genuinely funny is not necessarily sinful. However, to get in the HABIT of constantly joking and wisecracking about serious matters is an occasion of sin and should be avoided. That, I think, is the real moral danger when it comes to watching comical TV shows (either sitcoms or standup/late night comics) on a regular basis… you have to be careful not to pick up their attitude of flippancy, which is IMHO more likely to be an occasion of sin than any four letter words they use.