I guess it's to stop someone pressing the close button, jumping out and the toilet being locked with no one in there.
Also prevents unruly toddlers from getting accidentally locked in / locking their parents out.
More recent designs have a physical lock on the door - to mimic normal doors that aren't stupid.
@Howard started
London Fixed Gear and Single-Speed is a community of predominantly fixed gear and single-speed cyclists in and around London, UK.
This site is supported almost exclusively by donations. Please consider donating a small amount regularly.
I guess it's to stop someone pressing the close button, jumping out and the toilet being locked with no one in there.