I have grown up in Dar es salaam, Tanzania and have travelled a lot in the East African countries and I am quite surprised by that statement.
I am guessing it had more to do with the areas you went to/lived in. There are definitely filthy places and slum areas but there is also the good parts of town with good roads in Dar / Arusha and other cities. In that sense, even San Francisco and other cities that I have lived in in the US have filthy areas. Of course, it's more pronounced in these African countries but I wouldn't associate these countries with filthiness.
If it's the villages and small towns you were referring to, I think these are more or less similar in the way they are all across the area.
On a side note, I have recently been visiting Kenya more often (my dad works in Nairobi) and I would recommend anyone planning a trip to this side of the continent to consider Kenya + Tanzania trip(Masai mara + Serengeti, Ngorongoro). Especially if you're a nature and wildlife lover. It will change your life.