And, if so, is this a bad thing?
This is a short essay on modern law; specifically, how it is possibly irrational, and how this irrationality could in fact be necessary for large legal systems to operate. I conclude with some observations on potential wider significance of this phenomenon.
Modern Legal Reasoning
It is fairly well known that you cannot reason your way around breaching a contract's terms. Regardless of what is rational or commonsensical, you will be forced to pay on the basis 'the law is the law.' This literal-mindedness is known in legal circles as 'Legal Positivism.'
Legal positivism is essentially the view that 'the law' (the set of rules considered legally valid in a jurisdiction) is determined ultimately by social facts. Thus, when we want to work out the law, we look at historical processes, such as legislation going through the correct procedure, or judgements being issued from recognised tribunals. When you ask the small claims court 'why is the law the law' they can respond 'it says so according to the Invoices Act 1998, which was passed by Parliament.'
If the official takes the law as a non-defeasible reason for action independent from its practical or moral reasonableness, this can lead to irrational results. This is a symptom of law's reliance on arguments from authority: 'But why? Because X said so.'
Such rigid thinking is distasteful, and is met with the riposte 'just because something is the law doesn't mean you ought to follow it.'
The rational account of rule-following has a different approach. It goes something along the lines of: "in general, it is best to defer to legal rules, all things being equal, but should a legal rule prove demonstrably net pointless or harmful then it should be ignored."
Thus, behaviour should be oriented according to the law only if it 'makes sense', taking into a wide range of factors, such as:
- Deferring to the expertise of the rule-maker
- The benefit from consistent rule-adherence by all its addressees (ie, driving on the right side of the road)
- A meta-principle about when it is rational to follow a rule subject to 'exceptions' or to entirely revise it.
- The coordination benefit of using and following clear simple rules, even if on the face it would not benefit the rule-follower and, hypothetically, a collective of rational agents could act better.
- The usefulness of legal rules as heuristics for good decision-making, along the lines of rule-utilitarianism.
- Benefits of accountability ('rule of law') in having laws powerful officials must adhere to strictly regardless of what is rational.
This appears to be a reasonable way of approaching the law: do courts, lawyers, and most officials, actually treat law like this?
We do not know. At most, we know the law is applied consistently in modern legal systems with little discretion or rebellion by individuals judges, officials, or lawyers. This is what is called the 'massive agreement' point: the law is stable enough that big groups agree on it.
The challenge is then explaining this phenomena. The optimistic view holds that this is a 'massive consensus': all the judges agree on the current law because, all things considered, it is the best compromise between stability, justice, and, perhaps, for some of the other factors mentioned above. The cynical view holds there is 'agreement' for the same reason the military has 'agreement' on discipline, organisation, chains of command etc: there are conventions which the majority follow somewhat unthinkingly.
The second view is the legal positivist view, discussed above.
Let us assume provisionally this is in fact the dominant few at least in the context of commercial law: legions of petty officials applying the law like rubber-stampers. From personal experience with the law and lawyers, this is not implausible. It is frequently impossible to argue your way around an official determined to 'stick to the law.'
What does this suggest about the practical uses of blind obedience to the law?
The Value of Not Thinking
One is that the legal system actually relies on officials taking an unquestioning mindset.
Modern legal systems require consistency, and therefore predictability, to meet the needs of modern society. When similar facts come before the courts, similar outcomes must come out across the jurisdiction, over a steady period, and over thousands of repetitions. 
This is a challenge for a system built using people, given people have a tendency to diverge from one another and develop their own ideas. How to prevent this? One solution could be a system of thought which discourages active deliberation and free thinking. Instead of legal officials carrying out a rational calculus, they defer to authority. This prevents individuals interrogating the point of the rules they follow and possibly reaching different conclusion. Only with this structure, one which is arguably also present in the military and church, can homogeneity be maintained.
Think of this legal positivist mindset as anti-rationality memetic antibodies. To say 'that's not the law because it's irrational' or 'who cares if it's the law, it's irrational' is anathema to the legal positivist as it contradicts their belief law is valid based on its source alone. By resisting it, however, they ensure the continued smooth operation of the legal system.
- One form of legal reasoning, 'legal positivism', involves agents following the law because it is 'the law', regardless of whether it makes sense. Law on this model runs exclusively on arguments from authority.
- This view may be widespread in modern legal systems. Should future research confirm this intuition, it has ramifications for the usefulness of irrationality.
- Specifically, it implies that to maintain consistent behaviour amongst large numbers of agents, 'thought-terminating' ideas might be necessary to avoid individual divergence. Legal positivism could serve this role in the legal system.
- Intuitively, this might also be the case in institutions like the military, the church, and possibly highly conformist, traditional cultures, where highly consistent behaviour across many participants is required for survival or the completion of a task.
- Even if this is so, however, there may be alternatives to maintain consistent application of the law. Possibilities include digitising the legal system; training judges to be rational and aiming to produce a 'consensus of reasonable agents; accepting official-cog irrationality and focusing on those responsible for making and changing the law.
 Note, this is not the case across the legal system. Some areas of law require more certainty than others. High certainty areas are Property Law, Contract Law, Commercial Law, some areas of Criminal Law (Traffic law) and Tax Law.