They got rid of trashcans because of a terror incident and they saved a lot money by doing so (less workers).
Who wouldn't pile their trash? Who knows where&when the next empty trashcan comes along in Japan.
So the fix is to have people changing them more often + even having more available, but that would require more work and money.. blaming foreigners are just easier @
Mini rant
Japan also has a lot of unnecessary packaging and the birds can be very aggressive when trash is exposed, which doesn't help.