Brownsville Station was singing that song in the early 70s:
https://en.m.wikipedia.org/wiki/Smokin%27_in_the_Boys_Room
It obviously varied by area of the country, or perhaps school district. There was no smoking at our schools in the 70s.
It's way older than that. "Smokin' in the Boys Room" is originally by Brownsville Station, 1973.
Random ashtray history: the massive SAGE computer system (1958), built for air defense, had ashtrays and cigarette lighters physically built into the computer consoles.
But it changed mid-80s for students. There’s a famous 1989 song called “Smoking in the Boys Room” by Motley Crue, referencing kids going to the bathroom to smoke and then quickly leaving before getting caught.
https://m.youtube.com/watch?v=5oVBvxA0mm0
Smokin' in the boys room
Teacher don't you fill me up with your rule
'Cause everybody knows that smokin' ain't allowed in school
Checkin' out the hall, makin' sure the coast is clear
Lookin' in the stalls, nah, there ain't nobody here