People choose means in order to achieve certain ends.
They don’t have to act rationally – only to think that they do. For example, performing a rain dance has no causal relationship with the weather system, so in this case the means chosen are ineffectual in achieving the ends. The idea that humans act purposefully, and choose among various means they think will require the least cost and bring them closest to their ends, does not mean humans always make the right choice of means.
But, since humans have always lived in societies where their actions can affect other people, naturally there arose disputes. They could be over property rights (is this my apple because I picked it, or yours because the tree is on your property?), as well as over harm done to others (such as rape or murder).
In most moral and legal systems, certain means for achieving ends thus became looked down upon. If you set the end of acquiring a coat, it is perfectly acceptable to purchase the coat in a voluntary transaction with its owner. But if you take it without their consent, the means, though they may feasibly work, are looked down on as theft.
Another example is murder. Let’s say that you dislike someone so much that you simply must excise them from your life. You could ignore them, ask them to leave you alone, move away, or do any number of other things. Or you could murder them. The latter is obviously looked down upon.
Since in some cases, your choice of means harm others, they will want restitution, and for the legal system to efficiently deter crime, the consequences (weighted for probability of being caught) must exceed the benefits of committing the crime.
(Though they must not be so high that the consequences for a lesser crime exceed that of a greater one, for then the incentives shift to committing the greater one to cover up the lesser. An obvious example is when the punishment for murder exceeds the punishment for rape, in which case the result will be a lot of rapists murdering their victims to reduce the likelihood of being identified.)
But when in a society law stops being produced on a free market through dispute resolution, and is usurped by a gang of armed men who claim a territorial monopoly on dispute resolution and enforcement, inevitably victimless non-crimes become codified as crimes, and people become punished for arbitrary whims proclaimed through edicts, regardless of whether they hurt anyone else with their chosen means.
For example, someone who wants to escape from a life they find miserable, may choose to do so by imbibing alcohol. Regardless of whether this is an effective means for achieving his end (one might argue that changing his life for the better would make more sense), as long as the person doesn’t harm others in the process, we have no right to stop him.
If we are sick, we take medicine. The medicine may vary. It could be a pill, healthy nutrition, or plenty of sleep. Even if the medicine does more harm than good, at best we can try to inform the person of their mistake, but initiating violence against them makes us the criminal.
If we are upset or want to get high, we might take drugs. But if we hurt no one else – they have no right to force our hand and throw us in a cage for it. For however objectionable others may find the chosen means, they are certainly peaceful ones.
And the moment they stop being peaceful, all the other laws dealing with harming others and their property are at the ready to resolve disputes arising from harmful behaviour. If there are already laws against murder, there is no need to create new ones against murder with a knife, and murder with a firearm, or any number of other implements.
A swelling of the legal books with new laws can only breed injustice, because it makes it impossible for a layman to understand the law without spending thousands of hours in study, and makes legal representation that much more expensive.
More laws breed more criminals, and it also means that knowing what is and isn’t permissible is much more difficult, because both the grave crimes, and those that aren’t crimes at all, find their place within a by now incomprehensible legal code.
And when violence is initiated against a peaceful person who harms no one but (perhaps) himself, the result is the creation of a violent, unjust society. The lawmakers and enforcers of the law then become the criminals themselves, and this is but one of many steps in the inevitable decline and fall of a society which worships at the altar of the State.
Think for a moment how much higher the crime statistics would be if all the incarcerations for victimless crimes were classified correctly – as kidnapping and enslavement.
It should also go without saying that no territorial monopoly on dispute resolution can possibly be a third party in disputes involving itself. Your quarrel with the State will always go to a State court.
Therefore, law must always arise from actual disputes, and from the free market. It must never be dictated from a position of centralized authority, because the result will always be a legal system fit not to serve the people whose disputes it seeks to resolve, but rather to privilege the people who created it – the politicians, bureaucrats, and corporations; and under such circumstances the law will always be corrupted in favor of some at the expense of others.
Because if you want to know a sure way to lose a game – play against the people who made the rules.
(For those who are interested in reading more on the topic of law, I can recommend this excellent essay by John Hasnas.)