I strongly suspect that physically separating highschool students from their older peers for a couple of years meant that most of the older kids who were in to drugs etc. graduated and were not around to introduce their younger peers to these vices.
It's the flip side of the phenomenon whereby many university societies shut down and either never reopened after the pandemic or struggled to get going again (examples I know about including swing dance clubs and solar car racing teams), because the only students with enough experience to teach their younger peers had by then all graduated.