In my opinion, this film presents the conflict between modern civilization which emphasizes literacy and rules of law, and the Western traditional culture which is ruled by law of force.
The story takes place in the town of Shinbone where the people live here follows an unwritten rule: the man who carries the gun gets the power. One of the main male characters, Ransom Stoddard as an attorney at law with proper education, is the best representation of modern civilization in this film. He came to this Western state with a satchel full of law books but without a gun and got robbed and bullied by Liberty Valance, the villain representing savage cruelty, at the first night he arrived. Tom Doniphon, a rich and respected farmer in this town who is as good at shooting as Liberty Valance, suggested Ransom acquiring a gun to protect himself while this proposition was rejected by Ransom at first, because he believed crime shall be terminated by legal sanction instead of violence. There leads to a debate: whether a man need to carry a gun to protect himself or his belief.
At the very beginning, Ransom seemed misfit to this community. He believed in the power of law and attempted to find out solutions to every problem through his books. However, soon he found that most of residents here were not able to read and write at all. Therefore, he organized lessons for local people including both children and adults to teach them read, and more importantly, understand constitution and human rights. Shinbone was moving toward from an unnamed territory to a vote on statehood at that time, and residents were encouraged by Ransom to actively participation into the election. Ransom and the newspaper editor were elected as the representatives, but the rule of force did not give way to the rule of law until Liberty Valance was killed in a shootdown. It’s ironic that though Ransom firmly believe the power of law, the rule of law cannot be enforced in his willingness without violence.
I think what signals that the rule of force is replaced by rule of law in this film is, rather than the death of Liberty Valance, the time when Tom Doniphon shot Liberty but still give his credit to Ransom. He killed the villain in the illegal way, and he did not earn any reputation for it. The honor went to the man who spreads knowledge and stands for law. It also suggests that the personal heroism is outdated in the Western movies.