The western, as a film genre, typically depicts a frontier setting characterized by lawlessness in which different factions vied for power and rule, and often times a lone ranger (think the Clint Eastwood character The Man With No Name) comes on the scene and changes the balance of power.
That the western is characterized generically as taking place in the vacuum of law is all the more ironic since the western, at its heart, is about the purest exercise of individual autonomy in the Kantian sense.
The absence of law is only the absence of de facto law–that is, laws established by those who are in power in fact. The lone ranger archetype represents law in the Kantian sense, i.e., law that is derived from obeying noumenal moral truths that exist independently of any human institutions.
Kant defines autonomy as the individual’s capacity to obey the rules that he has given himself: in other words, self-legislation. Ideally, the individual’s practical reasoning can grasp the moral facts in themselves and obey them. In the context of the Western, this is exemplified by the lone ranger’s living to his own code of conduct, instead of conforming to some pre-established order of things.
Therefore, the only person who is truly autonomous in the Western is the lone ranger, because he is the only one that exercises his practical reasoning. It is not surprising that in most Westerns, this lone ranger character usually ends up being right, although his reasons for acting are unorthodox or incomprehensible to most other characters. All that demonstrates is that the lone ranger is the only one who grasps these noumenal truths.
So the Western is very deceptive in its seeming a-morality, since its core is undoubtedly morality itself. What the Western essentially is is a kind of morality play, at least in its classical conception. I’m not including the more modern ones because they are revisionist and deliberately play against genre conventions.
The fact that the lone ranger often has to fight against the supposed “law,” embodied by corrupt sheriffs and so forth, is all the more evidence indicating that the Western is concerned about a priori morality before any kind of institutionalization.