Based on the actual history of police departments in cities run by “machine” politics, noir detective novels weren’t shy about portraying the police as abusive bullies, semi- or completely corrupt, routinely perjuring while giving testimony, not above framing people, and more concerned with closing cases then actually finding those guilty. But given the Hays Code, for decades Hollywood had to go along with the propaganda myth that police were shining paladins of justice (or at most, a single bad apple who gets found out). So what was the first movie to diss the cops?
The silent Keystone Cops films?
Nah, the Keystone Cops were comically inept, not corrupt. (Also, they were pre-Hays Code.)
There were lots of movies in the 40s and even late 30s where the police were criminally stupid – series movies like The Saint, Boston Blackie, and The Falcon, where the hero was always getting in trouble with the police for things he didn’t do. Even the early Perry Mason movies with Warren William (1934 on) had the same trope. So the police were willing to charge nearly anyone just to close the case, until the hero comes along and uncovers the truth that they were too stupid to find.
I suspect this is not precisely what you were looking for, but certainly the police in these movies were not shining paragons of anything. For more gritty stuff, you’d have to look at the film noir genre, I suppose, and there are plenty of those with bad cops. But you’ll want to distinguish between one bad cop (Lady in the Lake, for example) vs. the whole department being corrupt, or the department being led by a bad cop, or a bad commissioner
Summary
(there’s a Thin Man movie, I think the third one, where the guy who done it was the head of the police commission)
.
There are probably earlier examples but the first thing that popped into my head was Serpico, from 1973.
Definitely by the 70’s after the New Hollywood movement had taken place, such as Chinatown (1974) and The Gauntlet (1977).
I’m not sure if Bonnie and Clyde (1967) counts because the protagonists were infamous criminals and cop killers, and the police were hardly likely to be lenient with them.
Serpico was my first thought, but the French Connection came out a couple of year before, in 1971. That has my vote as the first movie to really focus on the corrupt behavior of cops.
What about, “Serpico”? For its time, it was certainly a harsh condemnation of widespread police corruption.
Darn, Shoeless beat me to it! You guys are too fast for me! LOL
Googling, the Hays Code, mentioned in the OP, was effectively over by 1967. I wonder if any films negatively portrayed the police in its heyday?
What about the cop who murdered the carnie in Strangers on a Train?
Burt the cop shooting at a fleeing George Bailey and risking hitting a civilian? He did shoot out a light in the Pottersville sign.
I don’t think either example, at the time, was meant to portray the cops in a bad light. I think the actions were just normal. No one thought about stray bullets or car chase collateral damage in cop shows, even into the 70s.
Here’s one in which a police lieutenant is the leader of a gambling ring fixing college basketball games.
That’s the earliest example on this list:
A corrupt Sheriff, in league with a big, rich rancher, oppressing a small family man was a pretty common theme in a lot of really old western movies.
If that counts for the OP, I’d think some of them were very early.
How about The Big Heat (1953)?
Law enforcement is portrayed as being in the pocket of wealthy farmers in The Grapes of Wrath. The Joads are pleasantly surprised when the manager of the government camp informs them that “cops” can’t come in unless they have a warrant.
Kiss Tomorrow Goodbye (1950) has the corrupt cop stereotype.
Robin Hood?
Orson Welles played a spectacularly corrupt police chief in 1958’s Touch of Evil.
No one mentioned Casablanca? Renault is affable but he’s certainly corrupt.
I’m not a huge fan of detective fiction. It is perhaps a matter of opinion whether the police were compromised in The 39 Steps, as it seems, or were just unwilling to believe an unusual story over that of a spy who was an aristocratic local. Hitchcock’s movie was from 1935.