You can't imagine how you could write such a screenplay, let alone get it made.
Yet, "Cool Hand Luke" was written, was filmed, and even was nominated for Best Picture. Why? How was this possible?
I have a theory.
"Stranger in a Strange Land" was a 1961 science fiction novel by American author Robert A. Heinlein.
In it the hero is killed and the evil doers are not punished. Why? How?
This was possible because there were scenes in the book in which we see God in heaven is sending the Archangel Michael to earth on a mission. There are also other scenes set in heaven. And the hero on earth is named Michael.
You may not know it, but "Cool Hand Luke" was funded by Christians.
My theory is that some Christians became aware of "Stranger in a Strange Land" and decided to make a movie with that same plot element.
My evidence is ---
1] There are several images or scenes in which Luke is compared to the Christ.
2] Luke has not done anything sinful.
3] Near the very end of the movie, ---
. . a] The warden has warned Luke that if he escapes again they will kill him. Luke has escaped the 3rd time and is in a church.
. . b] He looks up and says, 'I have never believed in you (God), what do I do now?' None of these are the exact words.
. . c] He hears a car's brakes outside, and goes to the window to see the prison car outside with people getting out. He looks up again and says, 'Is that your answer?'
. . d] Soon after he is shot and wounded. Soon after he is loaded into the car, and we learn they will drive past a hospital to take him back to the prison infirmary. We learn he bled to death on the way.
. . e] Luke's friend and fellow escapee tells us that Luke had his 'cool smirk' on his face as he died.
. . f] We never see the prison people suffer at all.
I think that from the Christian POV, Luke won in the game of life, and he knew (the smirk) that God had welcomed him into heaven and he also knew that all of the prison people would be sent elsewhere.
All it lacks to be is a slam dunk, is the 1st scene being set in heaven in which the Archangel Luke is sent to earth on a mission by God. Or, a flash back scene at the very end.
. . . In any case, Luke fulfilled God's plan in his life, and God took him to heaven at the only time in his life at which he believed in God and Christ. God could have let him live, but maybe God knew that Luke would backslide as he was punished again by the guards. It was better to take him then. He had done what God had planned for him to do, give hope to the prisoners so some of them would also believe.
The whole point of this film is that, you win the game of life by getting into heaven, nothing else matters.