I think its a tricky balance to strike. In principle I agree with you in that a genuine need should not be refused, but how many teenagers would conveniently "be desperate for the loo" every time they had a lesson they didn't like so they could take advantage? How is the teacher meant to differentiate between actual need and the desire to skive? If all teenagers were reasonable, sensible and honest then toilet breaks in lessons would be no worry, but for some reason it doesn't work that way.
(that actually sums up how I feel about the unisex toilet thing, now I come to think about it: if all teenagers were reasonable, sensible and respectful there would be probably be no more problems than there are with single sex facilities, but for some reason it doesn't always work that way...)