The Egyptians lived and died by the annual flooding of the Nile. Anyone who impeded the flood (which fertilized the soil along the river) was probably considered as evil as a murderer, in Egyptian eyes.
True, but damming up the Nile would have been one hell of a challenge. And like many Commandments, this one is sufficiently blanket as to cover a lot of irrelevant turf... sould like you'd get your butt in a sling for damming up a single small ditch.
Perhaps the commandment-writer saw all the Pyramids going up and decided that one of these days some pharoh would get it into his head to build a pyramid in the middle of the Nile, and came up with this commandment to head him off at the pass.