I was in France recently and used a public restroom. It had an attendant, and a fee of €0.50. Charging for the restroom is unfortunate, but this setup is certainly better than eliminating public restrooms entirely.
Would much prefer this than what we have in NYC, which is go into a bar or cafe, buy something small and then use the restroom. Another thing I'll do sometimes is if I see a busy bar where the bartender isn't paying attention you can walk in, pretend you're looking for friends you're meeting, use the toilet and then sneak out.
As the result will be shit and piss elsewhere in the open, a compromise could be having shitty free public toilets and nice toilets where you pay (or maybe not nice, but bearable).
The alternative would be social workers, more psychotherapists, free healthcare, ...
That practically ensures that some people who have to go really badly, and for whom €0.50 is a big deal, will just drop their business on the sidewalk.
The 50 cents is dual purpose, the one is obvious in that it pays for the attendant and them keeping it clean, but the other is like using a coin to unlock a trolley, it cuts back misuse by a lot. Once you've been to free vs 50 cent toilets a few times you'll see (and smell) the difference.