School rules for going to the bathroom are perfectly reasonable
As a teacher, I hear a lot of people talking about students shouldn't ever need to ask to use the restroom. I understand the rationale but it doesn't really mesh with the reality of school and how students usually act.
At my school, students regularly use bathroom passes as an opportunity to wander around the halls, call people on their phones, and, in the worst cases, get into fights. Its our job to protect our students, so rules on bathroom usage are put in place to ensure these things have less of an impact.
On top of that, students aren't doing any learning if they're not in the classroom. A student spending 10 to 15 minutes in the bathroom during an hour-long class is going to miss most of the lesson need to do extra work to catch up. I don't think I should need to say why education is important and why not getting said education is a problem.
This complaint usually comes people outside of education who don't understand the realities of being a teacher. They just think "kids need to pee, teacher said kid couldn't pee, bathroom rules are bad!" This simply isn't how it works in reality. Teachers have to manage dozens of students. Having procedures for everything, including using the restroom, is just good practice.