The story
Originally a clipped form of gentlemen's room, originally a separate waiting room for men in public buildings such as railway stations but by the appearance of men's room also used as a euphemism for men's lavatories.
Etymology from Wiktionary, CC BY-SA 4.0.