Of course they don’t have to be dirty and can be well maintained – but that takes adequate funding to hire enough people to clean/maintain every bus/train car.
But as a country we’re very reluctant to pay for this sort of thing. Immediately there are accusations that the state/fed’l government is spending too much. So cities trim their maintenance costs. And the results speak for themselves.
Just like the amount of state funding for public universities speaks for itself. It shows where the priorities are. And it’s not schools (or extensive and well maintained bus/train systems.)