When I was a student of Danny Simon (Neil's brother and a very successful TV writer) one of his maxims was, "Don't go for the joke!"
This may seem like strange advice from a comedy writer, but what he meant was that you should stay true to the situation and the characters. If you have them say or do something they wouldn't logically do, you're sacrificing them for the sake of a joke. If you do that a lot, you end up with characters nobody believes. A high price to pay for a cheap laugh.
I was reminded of this the other day when I watched a few minutes of a US TV series called 911. It's on the Fox network, which says, "The show draws from real-life, high-pressure experiences of first responders who regularly face heart-stopping situations that are often unpredictable, intense, and uplifting at the same time."
One of the situations was an old guy who was working on an old car that somehow sucked his head, or maybe just his beard, into the innards of the engine. A woman who may have been his wife or daughter calls 911 and says the car is eating the man and starts to talk about his relationship to the vehicle, and when the responders show up she tells them the car is finally getting her revenge...this is while somebody she presumably loves has his head stuck and she doesn't know how seriously he could be hurt.
Yes, it's comic relief, designed to give the audience a breather from the more tragic plots, which is fine, but it was so obviously written to be a zany moment that it cheapened the entire enterprise.
The writer might say, "Hey, there are all kinds of crazy people who say just about anything." That's true, and if you've established that the character is like that before the moment of maximum craziness, it works. But in this case, this was the first time we'd seen these people.
I'm using a comedic example but you'll find plenty of examples in drama as well, with people saying or doing things solely because that's what's needed in order to advance the plot. It's not only dishonest, it's also lazy.
If in doubt, it's useful to ask, "Would a human being really say this in this situation?" If the answer is, 99% of the time, no, then it's worth rewriting.