See: homeless spikes vs homeless shelters.
The bathroom situation in some parts of Europe does seem like something that could be addressed. When I'm wandering around a European city and find myself with a full bladder, I'm always relieved to find an outpost of American corporate imperialism such as a Starbucks or a McDonald's because---regardless of anything else they bring---at least they bring clean well-maintained public bathrooms.
In the UK, walk into any pub and ask if you can please use the loo.
They're male-only, and just a metal spiral leading to a cement wall that you pee on, and a drain below that wall.
They're very simple & easy to maintain, and all you need to clean them is a pressure washer. Public urination is practically unknown with these around.
Now I am waiting for someone to sue over damages to expensive shoes or clothing because of a building owner's use of the paint.
But it's a cool undercover advertisement for ultraever dry!
Cost appears to be the reason. Plus presumably pursue from local businesses which feel they 'lose' custom if people can pee for free instead of having to pay for a coffee they don't want just to use the loo..