It’s not one crime, it’s all of them. The cost of enforcing one instance is more than the cost of all infractions, by all people. Enforcing such laws would turn the law into a farce.
You also have to include the cost of all crimes which would (statistically) happen if the first crime was not enforced.
Take, for instance, knives. In some jurisdictions and places, IIUC, knives above a certain size are illegal to possess in a public place (unless properly packaged and in the process of being transported). The cost of someone simply possessing a knife is obviously zero, but enforcement is expensive. So why is it (putatively) enforced? Because people possessing knives can commit other crimes, such as attacks and robberies. That is, one crime is enforced not because breaking that law is itself a cost, but because it might lead to other crimes, which are costly.
Take, for instance, knives. In some jurisdictions and places, IIUC, knives above a certain size are illegal to possess in a public place (unless properly packaged and in the process of being transported). The cost of someone simply possessing a knife is obviously zero, but enforcement is expensive. So why is it (putatively) enforced? Because people possessing knives can commit other crimes, such as attacks and robberies. That is, one crime is enforced not because breaking that law is itself a cost, but because it might lead to other crimes, which are costly.