Learning the hard way can be stickier. But it can also be devastating. STDs are a very permanent reminder to learn from the mistakes of others. (Not advocating sheltering kids unnecessarily.)
If they must learn the hard way, better it be on smaller problems than big ones. Better to lose your Roblox account to a scammer as kid than your bank account when you're an adult.