Common advice to novelists is that if anything in the story - scene, action, dialogue, description - fails to move the plot forward or reveal something about the character(s), it should be cut. This is mostly sound advice.
I recently read books by Janet Evanovich and Robert B. Parker (Stephanie Plum and Spenser series books respectively) and noted there were several scenes that did little to move the story and didn't give any new insights to the characters. The action or dialogue had nothing to do with the main plot and what the characters did or said was exactly what the reader would expect from what they knew of the characters.
The thing these unnecessary scenes had was humor. They were really funny. Stephanie Plum novels I think are primarily funny but some of the events are serious and scary. Spencer's cases tend to be more serious, but there is a lot of humor to keep the whole story from getting too dark.
Whatever the purpose, if humor can be said to have a purpose in a novel, these scenes could be cut without taking anything from the story. The plot line and characterization would remain unchanged. According to the aforementioned advice, they should have been left out.
I don't think it need to be argued that there is no valid reason not to have humor in a novel, even if it serves no other purpose. So, I feel this particular bit of advice should be amended: If it doesn't move the plot forward or add to characterization, cut it. Unless it's funny. Humor should be kept.