Young people realized drugs were deadly.
I wonder if rather than "the end of the counterculture movement," though, we should characterize it as transformation in the counterculture movement. The movement had begun with a focus on peace and love even before it became associated with experimental drug use. And as the 1960s gave way to the 1970s, the counterculture movement became very much a part of protests against the Vietnam War. Ongoing countercultural trends would continue, in terms of women's liberation and then rights for gay, lesbian and transgender persons. And drug use didn't end in the 1960s. The "war on drugs" continues to this day.
One shifting trend in drug use between the 1960s and the present is that heroin was the opioid people went to first when wanting the effects of an opioid drug. By the 2000s, prescription opioids had become the go-to choice for drug abuse. Heroin continues to be a drug problem too, with over 1 million heroin users in the United States, according to DrugAbuse.com.