The Film Noir aesthetic was largely imported by German Filmmakers emigrating to Hollywood in the 1920s and 1930s. One of the most significant figures in that movement was Fritz Lang, the director of Metropolis and M. Lang produced a number of Film Noirs, one pair in particular show how much of a master he was of the form.
(Spoilers) In Scarlet Street, Christopher Cross (played by Edward G. Robinson) after celebrating 25 years as a clerk in a New York business, decides to stroll through Greenwich Village to take it all in. He witnesses a man slapping a woman around and intervenes to stop him. The man gets away without Cross identifying him but he walks the woman home, Kitty March, played by Joan Bennett. They share a cup of coffee and the lonely, middle aged man falls hard for her.
Kitty's boyfriend Johnny, played by the always reliable Dan Duryea, who attacked her on the street, finds out that Cross is writing her, expressing his affection for her. He convinces her to play along with a scheme to manipulate him and milk him dry. Cross is married to a shrewish woman, and is a frustrated painter in his spare time, so his infatuation with Kitty brings him a renewed sense of happiness. Cross begins to embezzle from his employer to help Kitty pay for a new apartment.
Kitty and Johnny are both repulsive characters. Kitty is a lazy actress who doesn't bother to go to auditions and instead lolls around her apartment in a robe, shoving food into her gob. Johnny is a drunkard and gambler who doesn't hesitate to slap Kitty whenever she objects to any of his demands.
Once Cross is freed from his wife (through a highly convenient coincidence), he comes to Kitty to ask her to marry him. She laughs in his face, humiliating him. He snaps, kills her with an ice pick, and staggers away. Johnny is picked up drunk by the police and based on a high level of circumstantial evidence, he is charged and convicted of Kitty's murder. Meanwhile, Cross's employer discovers his embezzlement and he is fired.
Johnny goes to the chair, howling that he is innocent. Cross falls apart completely, degenerating into homelessness, shuffling through the city streets in shabby clothes, hollow eyed, haunted by the voices of Kitty and Johnny.
Scarlet Street is a great example of a dark Film Noir done right.
To contrast, we can look at The Woman in the Window, also directed by Lang, released the year before Scarlet Street, featuring Robinson, Bennett, and Duryea in similar roles. (Spoilers) Here Robinson plays a college professor who meets the woman who was the subject of a painting in storefront window next to his club. Just like in Scarlet Street, he falls for her while his family is away on vacation, but while enjoying cocktails at her apartment, her jealous boyfriend breaks in and tries to strangle Robinson. Bennett hands him a pair of scissors and he kills the boyfriend. They both decide the best option is to dump the body somewhere outside of town, and after a tense sequence, masterfully directed by Lang, Robinson succeeds.
It turns out the boyfriend is a wealthy investor and once his body is found the case becomes front page news. One of Robinson's friends at the club just happens to be the District Attorney, so he is able to get inside information on the progress of the case. They have tire tracks and possible witnesses that Robinson realizes could lead to him.
Meanwhile, Bennett is visited by Duryea, who is a crooked ex-cop who blackmails her in exchange for the fact that he tailed the boyfriend to her apartment on the night of the killing. Bennett and Robinson decide to silence Duryea by poisoning his drink, but Duryea catches on and leaves, threatening to expose her. Bennett phones Robinson to tell him their plan failed. But just after doing so, outside her apartment, a cop spots Duryea, who is wanted for questioning, and a gunfight breaks out where Duryea is killed and pinned for the murder of the boyfriend.
Unfortunately, before Bennett can call Robinson back and tell him the good news, he takes a dose of the same poison, committing suicide, convinced his arrest is inevitable and his life is ruined.
If the movie had ended there, it would have ranked as another Film Noir classic. However, the whole thing is revealed as a dream, with Robinson waking up in the club before all the events unfolded. He takes one last look at the painting, but when a floozy asks him for a light, he literally runs down the street promising to never stray again.
Lang claimed later that the dream frame was his idea, not something imposed on him by the Production Code Office. In the same interview, he expressed the need for happy endings (this was still during World War 2) and also expressed frustration that Hollywood was not supportive of experimentation. I couldn't find any mention of Production Code Office interest in the Film, so we must take the master's word on it.
So maybe by 1945, with the war winding down, Lang felt no need to soften the blow of a very similar story. Or maybe he regretted his prior decision and wanted to do it right. I do believe that the overall tone and narrative of Scarlet Street was many degrees darker and more ambivalent than its predecessor. The characters of Kitty and Johnny were sleazy and amoral and the protagonist Chris eagerly fled his marriage, stole from his employer, and allowed an innocent man to die in his place.
The anti-social nihilism of Scarlet Street was attested to by the number of local censorship boards that banned the Film, including my hometown of Milwaukee. The city censor of Atlanta labeled it "licentious, profane, obscure and contrary to the good order of the community," due to: "the sordid life it portrayed, the treatment of illicit love, the failure of the characters to receive orthodox punishment from the police, and because the picture would tend to weaken a respect for the law,"
Just what you should want in a good Noir.