As someone who studies stories pretty closely, the question of "When should characters do something stupid" is an interesting one.
There are entire successful movies built around pure, concentrated stupidity of the characters. Take Pulp Fiction for example. Most of it's story is based around people making absolutely asinine mistakes. Marcellus' wife almost dies because she took a bag of white powder from vincent's coat. She just assumed it was cocaine and snorted it, when it was actually heroin. Bruce Willis's girlfriend leaves his watch in his apartment despite being told how important it was, so he goes back to get it despite knowing it is where hitmen are going to be waiting for him. When he arrives, he finds his watch AND THEN STOPS TO COOK HIMSELF A POPTART. This is when he notices the machine gun that Vincent just leaves sitting on the counter of the guy he came to murder. Marcellus himself only didn't kill Bruce Willis because he was out getting donuts during his assassination mission. The rapists are too busy raping to notice they didn't secure their other prisoner enough to the point that he literally walks up and is able to take them out with a sword, despite them having a shotgun. The entire piece with Tarentino's character is because Vincent was dumb enough to casually wave his gun and he accidentally shoots marvin in the backseat. Samuel L Jackson's character arc is based around the fact that he simply cannot accept that a man shooting blindly and randomly would miss all 6 shots, when that's actually perfectly normal.
It's a classic and critically acclaimed movie with seriously stupid characters doing idiotic things, but never once have I heard anyone be actually frustrated with the fact. And I'm sure anyone can think of movies where the story is brilliant not despite characters stupidity, but because of it. The poor decisions made is the core of the drama. The Coen Bros are actually very frequent writers of it, for example, especially Fargo.
It's extremely difficult to pin down a rule of thumb for how and why it works when it does and does not when it does not. But one recurring element is that the movie, if not the characters, are seem aware that the actions being taken are stupid. Perhaps that is what BvS lacks, since it treats it's questions as things of grand philosophical quandaries of right and wrong, when in actuality, Batman can truly be reduced to being a stupid hateful paranoid dick. However, another avenue is when character stupidity serves some kind of theme, which Batman's stupidity definitely does. However, with Lois, her poor action doesn't provide any insight into her character or serve some kind of greater theme, it's just "oh, shit, I fucked up so now Superman has to fix my mistake and the movies padded out a bit more".
Still, it's hard to find a clear and concise answer as to what stupidity is okay and what stupidity is not.