In other words, the (usually) teenage dramatis personae of slasher horrors must indulge in some form of wild or inappropriate behavior before the Masked Killer offs them. In broad strokes, this means they must either smoke weed, booze it up, or engage in pre-marital sex.
In most slasher films, for instance, the sole survivor, not-to-mention destroyer of evil-doers is a woman, the so-called "Final Girl," and a character of strong insight and resourcefulness. Name one other genre in which an independent, clever woman overcomes all the odds, and defeats the villain through her own skill and smarts.
On the second front, the teens punished by the Masked Killer (the supernatural hand of nature, or God, as it were...) in slasher films are those who -- in defiance of traditional moral values but in accordance with a more permissive society -- knowingly indulge in bad behavior. These movies represent a carefully coded, but conservative response to the "do what feels right" 1960's.
Sure, have premarital sex and smoke weed all you want...but there will be repercussions.
You play, you pay.
Is it just luck or happenstance that the wicked die and the virtuous survive? No. Not at all. If you're smoking weed or having sex, you're somewhat less likely to notice/pay attention when the power goes out, when the front door is left unlocked, or when a killer wearing a hockey mask is hiding under your bed, I suppose. If you're paying attention to your vices and you're appetites, you're far less likely to be keeping an eye on your long term survival.
Films that have featured the Vice Precedes Slice-and-Dice paradigm include (but are not limited to): Halloween (1978), Phantasm (1979), Friday the 13th (1980), Dressed to Kill (1980), He Knows You're Alone (1981), Prom Night (1980), Terror Train (1980), Happy Birthday to Me (1981), Graduation Day (1981), Friday the 13th Part II (1981), Hell Night (1982), Humongous (1982), The Final Terror (1983), Sleepaway Camp (1983), The Black Room (1984), Friday the 13th: The Final Chapter (1984), I Know What You Did Last Summer (1997), Friday the 13th (2009).
Finally, any discussion of this particular horror movie trope must include a notable example of its inversion. The satirical slasher film Cherry Falls (2000), involves a murderer who is killing the town's virgins. Accordingly, all the young people of the town organize a giant party wherein they can relieve themselves of their virginity, thus removing themselves from the potential victim pool. In this case, vice prevents slice-and-dice!