
In both cases you have a person doing something that many people would consider bad. Then this person gets mad when others find out about their behaviour. If you don’t want people to find out you did something, maybe just don’t do it in the first place.
By that logic we shouldn’t ban anything for teenagers. But we do: smoking, gambling, alcohol, etc.