https://en.wikipedia.org/wiki/Minoan_civilization#Plumbing
There's also plenty of examples of different kind of early toilets/sewage systems from 3000 BC in different cultures: https://en.wikipedia.org/wiki/History_of_water_supply_and_sa...
I think you're conflating an image of victorian england with a world that existed 4000 years before.
Edit: as says the wikipedia article:
The Mesopotamians introduced the world to clay sewer pipes around 4000 BCE, with the earliest examples found in the Temple of Bel at Nippur and at Eshnunna,[13] utilised to remove wastewater from sites, and capture rainwater, in wells. The city or Uruk also demonstrate the first examples of brick constructed Latrines, from 3200 BCE.[14][15] Clay pipes were later used in the Hittite city of Hattusa.[16] They had easily detachable and replaceable segments, and allowed for cleaning.
Actually ancient civilization used to be very fragile entities that were collapsing on a regular basis. Quite amazing that the state didn't disappear as a concept - the concept was attractive to rulers and states came back invariably after yet another deluge.
i got this perspective from “Against the Grain - a deep history of the earliest states” by James C. Scott . Wikipedia has more about it: https://en.wikipedia.org/wiki/Against_the_Grain:_A_Deep_Hist...
The following is a hypothesis for how this could have occurred.
1. Hunter gathering requires a wider range of skills and knowledge than sedentary farming, such as knowing how to identify wild foods, being able to herd, ride, and hunt, and being self-sufficient with resources gathered on the move. If a generation of hunter-gatherers is prevented from living a nomadic lifestyle, this survival knowledge is lost and cannot be regained without costly and deadly trial and error. Moving from a nomadic to sedentary lifestyle is a one-way trip.
2. The environment hunter-gathers live in may suffer occasional periods of prey shortages due to unusual weather cycles causing ripples through the food chain. Although hunter-gathers can travel to find more food, there is a limit to how far they can search before resorting to drastic changes to their nomadic lifestyle in order to survive.
The first sedentary civilization could have been a band of hunter gathers that, during a period of prey shortages or simply because they were less skilled at hunting than competitors, resorted to farming in order to survive and forgot the skills they needed to revert to a nomadic lifestyle. But once they locked down a piece of fertile land and built up a food surplus, they could force other hunter-gathers to settle and farm during times of prey shortages as they would be the only source of stockpiled food in the neighborhood. Their descendants would be the first sedentary civilizations, and although they had less nutritious food and more labor-intensive lifestyles, it was more resilient to black-swan events that would wipe out a hunter-gatherer tribe and required less skill and knowledge in return for a life of hard labor. Once the first sedentary civilizations had a stable foundation, their high population growth and the inability of sedentary peoples to switch to a nomadic lifestyle and escape their rulers would set the historical trend.
I read that in Mesopotamia what came first was an economy centered around the temple, kings and state were a later invention. so it was probably a gradual build up. The temple economy may have been slightly less coercive,
Also there is the curious tale of Urukagina and his reforms - (has some parallels to the story of Akhenaten in Egypt) https://en.wikipedia.org/wiki/Urukagina ; incidentially the reformer guy Urukagina was not quite as tough as his predecessor and lost out to his external competitors. Having been seen as a lenient ruler was probably not a winning strategy
But these are all speculations.