The Wire, graciously excluded as it takes a nuanced perspective.
The truly bizarre aspect of so many of these is that the story tends to pit the main characters against 'the man', or 'the system'. But for any normal person, they are 'the man'.
For example, in The Rookie, the titular character gets shot at at an alarming frequency per episode. If cops had to endure so many shootouts, a) their life expectancy on the job would be in the order of a few months at most, and b) militarization and shoot-first-and-ask-questions-never would be understandable (not defensible, but understandable). Seriously, front line soldiers in war zones do not see as much action as rookie cops in LA presumably do, if the show is taken as realistic.
Or almost in any cop show, only guilty people ask for lawyers. And if the lawyers get someone out of jail, it is depicted as an injustice and a technicality.
The list goes on and on. Police procedural, both comedy and drama, suffer from a serious lack of verisimilitude.
There's no such thing as being good, and no such thing as being evil.
I was going to say that this was created in the wake of 9/11 and, for the US, it was a sort of catharsis. But the US hasn't existed without an enemy, it appears to proactively create them.
The X-Files is one of the few series I know to directly call that out, because that's been US modus operandi ever since the Brits and the Confederates stopped being an enemy. An entire episode is literally "what do we do? we have no enemies." But of course, the show continues with the invention of a new threat.
https://twitter.com/storyslug/status/1297996912822493196?lan...
Superheroes acting above the law is a fairly generic problem outside of that
There are all sorts of messy cross-correlative details too like big budget works taking fewer risks and being less original owing to the stakes.