Way back when I was in Middle School, they did this to us for the same reason. Um, having had to deal with this, this is pure SHIT. Sorry for the pun. Anyway, I think one of the things that should be in the Bill of Rights, is the right to use the freaking restroom!
Let me tell you, now that I am older, I would so not put up with that crap (bad pun), and sure as hell never would have stood for it in High School. I would have had a shit storm (sorry another bad pun) raining down on the administration and the district for that matter.
Also, note the name of the high school in the story and laugh! It's rather funny if you ask me. Um, ya, just incase you dont / cant watch the video, the name of the school is "Freedom High School". ROTFOL (Dont know what it means, click here to look it up)