I don't think I've seen a public bathroom in America in my lifetime. They're all privately owned, usually required through regulation.
But to answer your question, public things are paid for by the public.
We've got a ton of actually-public restrooms in my neck of the woods (in Ohio).
Public rest areas are pretty common along major highways and these include restrooms.
Publicly-owned parks usually provide a place to poop, too: Sometimes it's an installation with composting toilets, sometimes it's just a seat over a septic pit that needs pumped out periodically. Sometimes, it's fancy with flushing toilets and sinks for handwashing. Other times, it's just a rented portajohn (that may be full of spiders and smell like death, or be very tidy). And sometimes, they're locked at night when the park is closed. But -- usually -- public parks of any substance offer something for facilities.
Just last week, I worked next to a public park in a very small town (population ~2,000) with some well-maintained basketball and tennis courts. There were a couple of portajohns present. (I did not investigate them further.)
And when there's a major events that draw crowds, like our very public fireworks displays in downtown areas: Temporary restroom facilities are provided.
What we don't have very much of here are permanent, literal-public restrooms in the denser parts of cities. That is very problematic, but it is slowly improving[1].
[1]: https://downtownservices.org/news-article/three-public-restr...
> I don't think I've seen a public bathroom in America in my lifetime.
You've never been to the beach, a city park (or state or national park), a highway rest stop, or any of the thousands of other places public restrooms exist?
What a weird take...
Never been to a public park with a bathroom, or a state provided highway rest stop?
Many transit centers are owned and operated by a municipal transit agency and typically have restrooms, especially large airports and train stations.