The law of supply is a fundamental law in economics. It is used in the majority of economic theories either implicitly or explicitly. There are many factors that go into how supply is calculated but one of them is input prices. Basically, this says as input prices go up/down, suppliers will produce less/more and therefore the supply curve will shift.
Let's use this theory when considering laws. First, I will use a simple example like littering. Littering in my home state results in a $500 fine. The fine is set at this level not because littering actually merits a $500 fine but rather, it is unlikely to get caught littering so the price must be high enough to deter littering. There are some mathematics behind how they come up with $500 that I will not get into but that is the general theory. Clearly, if there was no such fine littering would increase due to the first paragraph. The price is less so therefore there will be more "supply".
Now, lets extrapolate this example to larger crimes. What is the price of murder? It could be a death sentence, or, if someone making $40,000 a year gets caught murdering someone 20 years before retirement that will cost him $800,000 (20*40K). This is not even including the chance of getting a pay raise, the cost of his leisure, his price on his right to vote etc etc.
I said all of that to reference a point of view I find to be absurd. Recently, I was in a discussion with someone that argued because murders take place even though laws prohibiting murders exist the laws prohibiting murder are unnecessary. The idea is the law does not deter the action so the law is useless.
This argument is simply ridiculous. Laws prohibiting murder exact a cost that is extremely high for those contemplating such action. However, without the law the cost drops to 0. To claim that murders won't increase, as my opponent claimed, is to defy economic law. Clearly, the marginal benefit of murdering someone will be greater than the marginal cost if the cost of murdering someone is nil. However, if the marginal cost is $1,000,000+ it is much more difficult for marginal benefit to be greater than marginal cost. Hence, increasing the price will deter people from committing murder.
Another economic reason why these kinds of laws are good for society is based on the division of labor. We allow other people to enforce justice on our behalf. When criminal activity ensues and harm is realized on ourselves or a loved one it is human nature to demand justice. If we were expected to enact justice every time a crime was committed against our person, property, or loved one we would have to stop our productive lives to pursue justice against the perpetrator. The lack of division of labor in this regard would lead to economic inefficiency.
This argument has nothing to do with governmental laws, governmentally provided police forces, or governmentally provided national defense vs. private laws, privately provided police force, or privately provided national defense. My argument is merely pointing out that any civil society requires these laws. Understood in this sense, I am appealing to how Bastiat understood the law; laws are instituted because the laws are meant to protect what preceded the legal institution in the first place, namely, person and property.