Most of them were bad, but even the worst prison movie was more complex than the average western. The best westerns rose above cowboys and indians clichés, but they were few. Every prison movie dealt with the same themes as Kafka and Dostoevsky.
The great prison narratives are novels, but even in Hollywood prison movies there was always the feeling that the society outside the prison, which the prisoners remember and dream about, is only a dream. Reality is the prison.
In bad prison movies, the protagonist was innocent. Either he’d been ‘set up’ by the person who actually committed the crime of which he’d been convicted, or he was the victim of an unjust legal system. The latter implied that the society outside the prison was just as bad as the one inside, while the former attributed all the evil to one specific villain and absolved society as a whole of any responsibility for his villainy.
In the worst prison movies, the protagonist was a cop or some other agent of the law who'd gone into prison ‘under cover’ in order to expose the brutal conditions inside, conditions which people outside the prison supposedly know nothing about. Often its evil was the fault of a corrupt warden, and after he was exposed and arrested all was well.
In the best prison movies, the protagonist was guilty. He didn’t pretend to be innocent, and was ready to accept his punishment until he discovered that the agents of the law, who'd judged and convicted him, were even worse criminals than he was.
No one is innocent. There are only different degrees of guilt. The great criminals make this world what it is, and the petty criminals are their accomplices, including those who know what they do but do nothing to stop them.
Everyone knows, and everyone pretends not to know. Everyone pretends to be innocent. They must, because they no longer believe in a god who'll forgive them anything as long as they believe in him.