Yes, the plot can be illogical and obnoxious. Yes, your lead actors could be awful. But beyond the obvious, it's good dialogue in movies that can mean the difference between success and failure.
Now, swearing in films--especially excessively--can be considered crass and unnecessary by some; others, however, may see it as simply another vernacular set within a film's certain setting. But no matter your views on cursing, one thing is certain: it's vital to the success of a film.
By this I mean, if a character swears excessively, or perhaps not at all, we as the audience are given valuable insight into who the character is as a person.
As we learned in class, curse words have meaning, history and intent behind them. For instance, when you call someone a bitch, you're likening that person to a female dog meant for breeding. So wouldn't it be a logical conclusion that if a character does or does not use these words that their choice is also a part of their intended message they're trying to send?
For example, "Pulp Fiction" is Quentin Tarantino's 1994 cult hit and almost everyone can quote at least one line from the film. The movie is famous for its violence, style and rampant swearing. Jules, played by Samuel L. Jackson, is best remembered in most viewers minds from the scene above. In the scene, Jules is toying with a young man who's betrayed Jules' boss, crimelord Marsellus Wallace. During the encounter, Jules, naturally, swears excessively while the young man being interrogated never does. The purpose of this it that it helps establish a power relationship between the two characters. Jules, by swearing and calling the kid names like "motherfucker," is setting himself apart as the more intimidating, stronger and more alpha-male of the pair.
Thinking back to earlier in our class when we learned about the communication model of sender-receiver, we learn that when we're being given a message we first encode/decode what is being given to us. By Jules swearing--along with other factors--he's verbally sending the message to the boy that he means business and it also incites fear in him as well. Essentially, by Jules' excessive swearing it makes it easier for the boy to encode closer to the nose of what Jules is trying to say.
However, it doesn't always make sense for a character to swear. I'm sure we could think of many many collective examples which prove this. A more interesting example of this would be the character Nina Sayers in "Black Swan."
Nina is very passive, demure and polite--she also doesn't swear for the entire first half of the movie. By keeping her language fairly "clean" we as the audience are in a way encoding Nina's words and behaviors, and shaping her personality subtly in our head. However, once Nina begins to lose her mind, we see her personality change. She becomes more sexually liberated, forward and aggressive. One of the subtler changes that tips us off to her inherent change is when she does swear for the first time.
After a night of uncharacteristic partying, Nina comes home to a confrontation with her domineering mother. During this fight, Nina says she "fucked" two men she was clubbing with. Now this is a pretty crass choice of wording--especially to your mother!--but it's intent is to tell the viewer that Nina has fundamentally changed. It would've been a very different situation if Nina had simply said "I slept with them both" or something along those lines.
Essentially, there is an art to swearing in movies. Some people master it, others do not. But always be mindful as a viewer what it means if you're being given a world with excessive cursing. It is rough circumstances and swearing is their way of letting off steam? Are they alpha characters trying to establish dominance over others? Or if they do not swear, what does it help us understand about them as people?