The article seems to focus on historical public toilets* - mostly urinals - but this is a valid question concerning the last decades as well.
Because free public toilets used to be a thing in cities big and small all over the world (but in my story in Europe), not so long ago.
It's interesting to see how the administration chooses to treat this topic. Structures like this one can be free, or have a coin slot that takes €1 or so. I heard in some Asian countries you can get toilet paper by allowing the toilet to sell your personal data.
In other countries public toilets and their typical stench have slowly disappeared - or been "improved" like this.
* An American comedian came to Europe and asked the technician if there was a bathroom, shortly before going on stage. The technician thought for a while and answered: yes, but it's a 5 min walk. What a barbarian place! She told that story on stage, that's how I know.