Answer:
Some of the elderly, born during the Meiji (1868– 1912) and Taisho periods (1912– 26) sometimes refer to the lavatory as gofujou, or “filthy.”
Lavatories in Japan were formerly a large opening into which feces and urine were deposited. The contents were then pumped out when full. The smell was awful and unbearable! It was indeed filthy–full of maggots and attracting large, greenbottle flies.
In the past, lavatories were not built in Japanese houses but built a short distance away from the house. Slippers were worn to where the lavatory was located. Although it was a part of the structure of the house, it was built so that it was separated by a corridor and located the farthest possible distance away from the living room.
The latter half of the twentieth century saw the improvement of the sewage system in major cities and flush toilets became commonplace in many homes. There are now no problems regarding sanitation with flush toilets.
However, the concept that lavatories are filthy is still entrenched in the Japanese mind. They are not used to the idea of entering a lavatory after walking across a tatami mat with bare feet, or with slippers used to walk across the floor of the living room with. And for this reason, slippers exist for exclusive lavatory use even today.
Here are other posts you may like! :)