Sure, you could enter the black market. Presumably that would carry similar penalties as selling alcohol to minors. People certainly do that but at least my personal experience growing up in the US was that it was substantially easier to come by narcotics in highschool than it was alcohol.
Why would a foreign state bother to interfere with such a system? Violations are even less harmful than underage alcohol consumption. (Which is itself typically fairly benign. I will never understand why people in the US make such a big deal out of it.)
If you worry about every possible thing that can go wrong you will inevitably arrive at a surveillance state. Thus these eventualities need to balance the downsides imposed by any solution with the downsides of circumvention or other abuse. In this case all that's required is a very minor but legally enforced speedbump to force the hand of website operators and nudge cultural norms towards a healthier place.
Also if such identification cards are that easy to get, it is inevitable that the majority of kids are going to get access to them. I or somebody else could go across town to different stores, get 30 different ID cards, and then sell them for $15 a piece. And that is of course assuming foreign states and people don't break or circumvent the situation and sell ID codes online.