Your observation is a Scandinavia thing.
Mainland Europe's free public restrooms are not nicer than the US.
That tracks, I was actually shocked by the state of the average public restroom in Switzerland.
I wish Americans would stop conflating some small part of Europe with the entirety of Europe. Scandinavia is of course within Europe, btw. Things may be handled vastly different depending on where you are in Europe. One small part of it does not define the rest of Europe. This is why you can't really compare "the EU" to "the USA" (Norway, while being part of Europe, is outside the EU btw). Not directly, anyway. Maybe some day, Europe will be much more homogeneous, but for now it's a pretty culturally, politically and economically diverse continent. Some European countries have epic public toilets. Others, not at all. It all depends on which country or culture you visit.
Gas station restrooms in Germany are possibly bearable, but annoying since you need to ask for keys - I have used them about twice in 25 years of driving. Autobahn restrooms are either pretty disgusting or paid.
Iceland is not Scandinavian, but it is Nordic (as a Scandinavian, English speakers conflating the Nordics and Scandinavia is a pet peeve)