As a teacher, I can understand the thought process behind the policy.
I currently teach 7th grade special ed half days, and there are definitely students or whom the bathroom functions as an escapist behavior. There is one student in particular who literally every single day when she comes into 5th hour she has to go somewhere. If it's not the bathroom, it's the counselor or the nurse. What slays me is this class is right after lunch, and they always have plenty of time to use the restroom, they also have a passing period in between.
What we have done on our team is give the kids four hall passes for each class per quarter. If they ask me if they can go to the bathroom I will ask them if they are absolutely sure they cannot hold it until the end of the hour. If they say they can't, then they bring me their hall pass and I cross it off. If they use all four passes, then they have to take a tardy. At least 3/4 of the time though, they say they can hold it and they wait til passing period. Obviously, elementary school is a little different since you don't have an opportunity every 50 minutes during passing period.
The struggle for me as a teacher is to discern which students truly need to use the restroom, and which are using it to get out of class. We are actually trained in my grad program to pay attention to patterns of behavior and take action if we find that a student always has to use the restroom during a specific class, or when there is a test, etc.
Obvously this is not the case with the OPs daughter, but I thought maybe I could give you all some perspective of the other side of the issue. For the record, if a child has to go, I do not deny them the opportunity. If I notice a problem I bring it up with the counselor, nurse, and their parent so we can see if it is a true physical need or if the behavior is serving an alternate purpose.