It's ridiculous to hear teachers bleating on about this, because they aren't doing their job properly and maintaining control of the class - so that pupils are only asking put of genuine need, and not to muck about. With respect, if your pupils had more respect for you, you wouldn't be concerned about this, and would be able to trust that they'd conduct themselves properly.
If as a teacher you needed the loo (you were on your period and felt you were leaking, or you felt your stomach churning to herald a bowel movement about 20 mins ago and you realised you just couldn't wait another 30 mins for the lesson to end, are you honestly saying you would
a) flood all over your clothes / chair or
b) shit yourself?
Like fuck you would. You'd get up and leave the classroom for 5 mins, like teachers have done since time immemorial. In my schooldays teachers often used to leave the room for a chat, to get a tea/ coffee, or for a fag, but anyway...
So if a teacher would leave the room and consider it a basic necessity to do so, why should a child not be able to in the same situation?
Claiming it's due to risk of vandalism etc just smacks of lack of discipline, apathy and incompetence on the part of the school. As for the well one kid might do it, you're punishing many for the crimes of the few, which is pathetic.