There actually is such a thing as non-gratuitous humor, where the humor comes from the plot line itself. But much humor is gratuitous—a situation or gag stuck in the story just for laughs. Take it out and the plot would run along fine; it just wouldn’t be as funny.
I pondered all of this while watching the recent Star Trek movie over the weekend. SPOILER ALERT. Take, for instance, the scene where Bones gives Kirk a vaccine that makes him sick in order to get him onto the Enterprise. That scene is necessary to move the plot forward. What is not necessary is that Kirk has a reaction to the vaccine; that complication exists solely to inject humor into the scenes that follow. Likewise the scene where Scotty and Kirk materialize on the Enterprise and Scotty finds himself in some sort of cooling system. Again, that complication is played out solely for laughs, to make their arrival on the Enterprise more interesting. In fact, one could argue that it's the humor that makes this movie enjoyable to watch; like The Voyage Home, this Star Trek movie goes for the laughs.
Yet while gratuitous humor does not bother me, it occurs to me that the word complication could actually be used to describe the gratuitous scenes of violence that I find boring and annoying. So perhaps the truth is that I simply have more patience for humor than I do for violence? Hmmm…
On a side note, We got rain!