Last week my mother got groped at Mass
What ever happened to class?
-cut lyric from Kander & Ebb's "Class"
Being funny in song is one of the hardest things a writer can do. If comedy is about timing, think about how hard it is to make a joke's rhythm work when the time is mapped out as rigidly as in song. Lots of songs make us smile at their cleverness or quirkiness, but laugh out loud? That's a high bar. In the BMI Workshop, they've talked about how the punchlines have got to always be in the same spot metrically--except when they're not, and you want to give the gift of surprise.
The above lyric was cut from the song "Class" when it was met with a "deafening silence" in a preview, according to John Kander, who did a BMI master class a few years back. "It drove my late partner crazy," Kander said then of Fred Ebb. "He never knew what was going to be funny. The only way to know is get it up in front of an audience." David Yazbek, who was on hand for the same master class, said that "Chimp in a Suit" from Dirty Rotten Scoundrels is one of his own personal favorite songs he's written, even though he admitted that he "never thought it totally worked" with audiences.
I'm actually at a loss to think of songs, in musical theater or otherwise, that have actually made me laugh. A well-performed "A Little Priest" has done the trick, if I recall right. Beck's "Hollywood Freaks" almost always makes me chuckle. On a good day, Allan Sherman still gets me. As far as musical theater goes, Marx and Lopez are fine craftsmen, of course (and Lopez's work with the South Park boys is, of course, duly anticipated).
I welcome other examples, dear readers.