When did crime begin to pay?

I've been introducing some friends to the Ealing comedies. We started with the Lavender Hill Mob, which was showing at a few London cinemas in a restored print, and followed a couple of weeks later with Kind Hearts and Coronets. If you haven't seen either one, I'm about to spoil the endings. I'm also going to spoil the ending of Anatomy of a Murder so don't read further if you haven't seen those films.

The crooks in the Lavender Hill Mob don't get away with their heist and, though the ending of Kind Hearts is ambiguous, it's fairly likely that the central character there doesn't get away with his crimes either.

That ambiguity was a little too much for the Americans, however. An extra 10 seconds of Kind Hearts was filmed which did away with the ambiguity so that the film would comply with the US Production Code.

Watching those films raised a question that has puzzled me for years. When did crime begin to pay in the movies? The Ealing comedies are notable for their witty approach to ensuring that the crooks don't get away with it but they still put you in the position of rooting for the criminals, only to disappoint you at the end. They simply aren't allowed to give you the satisfaction of seeing Alec Guiness's bank robber enjoy his riches.

But we've also seen films in which the crooks to get away with it. Whether they are heist films or courtroom dramas with a twist, at some point it became acceptable for the bad guys to succeed. But when?

The Motion Picture Production Code provides a clue. The code set the boundaries of what was allowed on film. Obvious things such as nudity and swearing were prohibited. There were also rules about interracial relationships, homosexuality and, of course, crime. According to Wikipedia, the code required films to ensure "that throughout, the audience feels sure that evil is wrong and good is right".

The Wikipedia entry lists Anatomy of a Murder as one of the films that helped to bring about the Code's demise. That film deals with the trial of an army lieutenant who is accused of murdering an innkeeper. He claims that the innkeeper raped his wife.

James Stewart's lawyer manages to get the lieutenant acquitted but the end of the film casts doubt on the man's story. The innkeeper may not have raped his wife after all and the lieutenant may have killed him in a drunken rage.

So it's possible that the criminal got away with it in Anatomy of a Murder but, again, like Kind Hearts and Coronets, it's not explicit. My search goes on for the earliest film in which the criminals escape justice.