There are many inherent incentives that we correct for with laws. The incentive for people to shoplift is high, but we counter it with the threat of fines or jail. Similarly, the incentive is to raise prices / undercut wages / do arbitrage... and we can counter that with similar punishments.
I'm not saying I have the magic formula for how to codify such crimes and what punishment would be appropriate, but it took us hundreds of years to figure out how to effectively deal with even very basic crimes (and some countries still struggle with those).
Why does a kid in kindergarten that hoards all the crayons for himself get told off, but buying all the masks during a pandemic to sell at an insane profit was considered valid economic activity? We have arbitrarily decided that various tiers of "being an asshole" are somewhere between ssocially unacceptable and criminal, but if you're making money, being an asshole is fine. We can change that.