I can't recall seeing a window in any of the toilets Iof planes I've been in, but supposing there is a window in teh toilet of a plane and its parked near the terminal building and a pssenger wants to 'freshen up'?
Its not like a train, you can flush the loo when the planes on the ground
I think modern aircraft have dispensed with the conventional window in the loo, but when it was there, I imagine it's inclusion is psychologica - some people would feel inhibited without the familiar surroundings of a standard toilet - this is entirely educated guesswork, but it sounds reasonable to me.