Exactly! Comedians aren’t funny when they have opinions. They’re only funny when they tell jokes that are carefully calculated not to make anyone upset about anything.
I’d say there’s a difference between expressing an opinion, and moralizing about it. One can make great comedy with the former, while the latter sucks because the comedy is completely subjugated by the message. It’s the same difference between heavy metal and Christian metal. Same instruments, same basslines, etc., except the latter is trying to push you towards belief, and thus it’s annoying.