Depends on how common Mold Earth is. Most people have no idea how slow it is to move dirt by hand. The construction estimators will tell you a person with a shovel will move under 23cf of dirt/hr*. Mold earth moves 125cf every 6s. This is on par with a 100hp excavator.
In an hour a 1st level caster (or magical race) can open 3,000ft of 5ft deep trench. That would take the shoveler 225 days.
I want to repeat that: One (1) hour of cantrip Mold Earth can replace 225 people working for one day. (At 2sp/day each, that is 45gp of labor)
One person with that cantrip can excavate a massive sewer system in a few weeks. (15 days x 10hrs x 60m x 10 rnds x 5ft /2 (open & close trench)= 225,000ft =~ 42mi of sewers, or almost 3 miles of trench per day)
You will need pipes in those trenches. Simple clay sewer pipes can be a log, split lengthwise, the heart burned out, then tied back together and slathered in clay. The clay acts as a seal, the charcoal layer is a protectant and the wood fibres are reinforcement. Most will last a few decades but I have personally watched a 100yr old wooden sewer pipe be replaced.
Much of that is work that an Unseen Servant can manage: charring wood, putting out a fire, tying rope around log halves, coating them with clay. Our 1st level caster could have 6 of those going at a time via ritual casting.
For bigger sewers (5-10ft diameter), brick is common. Again unseen servants can make bricks and handle laying the bottom course. A skilled bricklayer would need to do the sides and arch. Or....our caster could Mold Earth a, well, earthen mold, and the servants lay the bricks on the dirt. Then the dirt could be moved out of the way once the mortar dries. They could do 30ft spans (the range of Mold Earth).
So...in my opinion, the d&d cities have pretty good sanitation. Downstream water quality may be absolutely atrocious, but the cities will be pretty good.
Of course, in my opinion, communities should offer a life of luxury to any 1st level dirt-mage and offer them bodyguards. Mold earth is worth 45gp/hr of unskilled labor. If they work just 40hrs a month, that is 22,000gp of labor/yr the community can use to grow food, produce goods, etc.
Sewers, drainage, road repair, excavating basements are infrastructure that last years, if not generations.
*don't take my word for it:
How Long Does It Take To Dig a 6 Foot Hole? Production Rates For Manual and Mechanical Excavation in Light, Medium and Heavy Soil - Estimation QS