That's the thing: It is deeply ingrained in the very foundations of Japanese culture and society to always conduct yourself in a manner that will at the very least not hinder others unnecessarily.
Japanese are raised from the very beginning to be ashamed of making a mess and not cleaning up, to be ashamed of being irresponsible. Everyone is taught that "the Sun is watching you", that someone (or something!) somewhere is always watching you and judging you for your actions.
A westerner might shit up a public restroom, intentionally or otherwise, and say to himself "I don't care; cleaning this up is the janitor's job."
A Japanese person won't even dare, because they are taught to clean up regardless of a janitor.
It is a common tradition and mandate in Japanese schools for students to clean their classrooms (and every-so-often even restrooms!) themselves at the end of the school day. Yes, the schools have janitors, the students are told to clean up themselves anyway because that's just how good people behave.
This is all a facet of education and parenting, and the result of generations and millenia of such teachings. Their thought processes are fundamentally different from the west: A better society starts by being better individuals themselves first.
Public restrooms in the west being an absolute shit show (pun intended) are a reflection of failed education and parenting in western society. The west can, and should, do better.