Dashiell Hammett certainly leaned to the left politically and even went to jail during the height of Marcarthyism because he refused to testify against Hollywood friends and acquaintances who might have had communist affiliations. His novel might be read as an indictment of capitalism because its main theme has to do with the way money brings out the worst in people. But Hammett himself made a lot of money from Hollywood because he was a very good writer and was especially good at writing dialogue. He has been compared with Ernest Hemingway in his talent for writing dialogue.
What appealed to John Huston about The Maltese Falcon was its characters, its fast pace, its hard-boiled tone, its crisp dialogue, its solid plot, and its objective technique emphasing action and speech. Huston's movie version does not seem especially political one way or the other. If anything, the movie could be interpreted as an illustration of Social Darwinism. Sam Spade is a strong, independent, self-reliant man who sees life as an ongoing struggle in which humanity progresses because of the survival of the fittest. Spade could hardly believe in socialism or communism since he doesn't trust anybody. His interview with his lawyer is illustrative.
In Chapter 12 he gets Sid Wise to tell him everything Iva Archer confided about her activities on the night her husband was murdered. Then Spade asks:
"You believe her?"
"Don't you?" Wise replied.
"How do I know? How do I know it isn't something you fixed up between you to tell me?"
Wise smiled. "You don't cash many checks for strangers, do you, Sammy?"
"That''s right--I'm selling you out. Why don't you get an honest lawyer--one you can trust?"
"That fellow's dead."
It is not unusual for a young person to be attracted to left-wing politics in college and then to become more conservative after exposure to the truth about human nature in the real world. The Maltese Falcon is about the real world. It can be interpreted as saying "People shouldn't act this way" or as saying "This is the way people really act and nothing can be done about it." John Huston's spin on Hammett's novel seems to be leaning to the right, showing a distrust of government and an emphasis on self-reliance.
Sam Spade certainly is a representative of private enterprise. He is virtually alone in his precarious profession. Everyone, with the exception of his loyal secretary Effie Perrine, seems to be working against him. He knows this to be a dog-eat-dog world, and he accepts it as such. He doesn't expect it to change. This is the attitude of businessmen generally. This is the attitude of conservative Republicans generally. Spade hasn't any illusions. He explains his simple code in the last chapter in beautiful American vernacular, beginning with:
"Listen. This isn't a damned bit of good. You'll never understand me, but I'll try once more and then we'lll give it up. Listen. When a man's partner is killed he's supposed to do something about it. It doesn't make any difference what you thought of him. He was your partner and you're supposed to do something about it. . . ."