We always hear that people in Japan follow the rules. That’s why people are polite and the streets are so clean. (Someone should inform the rats in Kabukicho they’re disturbing the wa.)
Of course, anyone who’s nearly been killed by someone on a bicycle in Japan knows this isn’t true. Another telltale sign that stood out to me the more time I lived in Japan were all the signs – always in Japanese, never translated – that warned against doing something you would think would be common sense: 立小便 (tachi-shōben), public urination

To this day, you can spot these old-looking signs in underpasses and near bridges. (There’s a sizable one, for example, near Megurobashi in Meguro.)
Why does a nation so presumably hell-bent on rule-keeping need signs telling people not to piss in public? The more I dug into it, the more I discovered a fascinating history ranging from Edo-era fertilizer to the modern bubble economy of the Shōwa Era, which saw neighborhoods put little Shinto torii gates everywhere in an effort to discourage relieving yourself outdoors.
Welcome, ladies and gentlemen, to the definitive article on Japan’s untold history of public urination. You’re welcome.
Edo: When public peeing wasn’t just allowed, it was encouraged

Japan’s Edo Era (1603-1868) is a pivotal moment in the country’s history. The 265 years of peace secured through the Tokugawa’s system of hostage-taking led to an explosive era of creativity. A lot of what we consider Japanese culture, from Kabuki theater to sushi, dates back to Edo.
The Edo Era also had a lot of public pissing and pooping.
Fertilizer for crops was a precious commodity in the Edo Era. Japan had little contact with the outside world during this era, which means it had to have a largely self-sustaining food supply.
One of the most prized forms of fertilizer was human waste (下肥; shimogoe). Farmers actively went around and collected “night soil” from residences. Landlords made a solid 1-2 ryō a year selling their tenants’ urine and feces. (1 ryō works out anywhere from $650 to $2,600, depending on the period of Edo.)
To further encourage collection, farmers set up public urinal buckets (小便桶; shōben-oke). By 1784, there were 160 such spots across Nihonbashi, Asakusa, Shitaya, Honjō, and Fukagawa (modern-day Kiyosumi-Shirakawa). By 1872, 1,564 of Tokyo’s 6,545 river boats were dedicated to shipping fertilizer.
In other words, public peeing in Edo wasn’t just accepted. It helped feed a nation.
Meiji bans public urination – and the people rebel

All morally questionable things must come to an end. Eventually, the Tokugawa’s hostage-taking system collapsed, opening the door to the Meiji Era.
It was then that authorities started taking a dim view of public urination. But not due to any moral scruples or notions of cleanliness.