> If it's a crime, then selling to anyone of any age is still just a crime. But if it's only a crime to sell to under 18/21 then legal shops will avoid selling to the under age to avoid revocation of their license.
That isn't true; crimes can have aggravating factors and selling drugs to a minor could aggravate the crime of selling drugs.
I don't think the laws were written that way, but they could have been.
>could aggravate the crime
For dealers this would mean almost nothing when the punishment for dealing already lead people to do things like get in shootouts with police.
Meanwhile legalization of some drugs has directly shown that it decreases youth usage.
There is an incentive to commit a crime when the benefit of committing the crime exceeds the penalty times the chance of getting caught plus the cost of measures taken to avoid getting caught.
This is why increasing penalties have extremely fast diminishing returns. As the penalty goes up, the relative cost of measures to avoid detection goes down, and the penalty needed to counter them becomes exponentially larger.
If the benefit of doing the crime is a million dollars and the penalty is a 50% chance of a year in prison then you have a problem, because plenty of people would be willing to take the risk. But it's actually worse than that, because spending $100,000 on countermeasures might lower the risk of getting caught to 1%, and they're still making $900,000. That might not be worth it when the penalty is a year -- maybe $100,000 in profit is worth a 50% risk of one year? But if you set the penalty to 20 years then it is. Then the gain is $900,000 but the expected penalty has actually fallen to 1% of 20 years, i.e. expected cost of 2.4 months instead of 6. To deter someone with a $900,000 profit who values a year at $120,000 with a 1% chance of getting caught, you would need the penalty to be 750 years, which you can't do because people don't live that long. And spending even more on countermeasures might lower the risk of getting caught even more. If spending $500,000 makes it 0.1%, that may not be worth doing when the max practical penalty is ~70 years, but the option for it means that even 750 years would be insufficient even if it was possible.
This is why there are things it's very difficult to deter. The profit from doing them is more than the cost of making the probability of detection small and then the size of the penalty can't be made large enough to be a deterrent.
That all changes when you legalize most of the market. Now the profit isn't a million dollars, it's $100,000, because anyone can enter the market so increased competition drives down margins. Moreover, $90,000 of the profit was from selling to adults. So now the profit from selling to kids is only $10,000. Not worth spending $100,000 to lower the risk of getting caught. And then you can easily assign a moderate penalty that acts as an actual deterrent.