They did everything right. It was a 1 in a thousand year storm that overflood the two nearby creek / rivers. These rivers then broke nearby manmade earthen embarkment that surrounded the town aka the levees and then the town flooded even though everyone thought the levees were high enough and strong enough.
If we use this standard then almost no town built near water would exist even though most towns exist due to being near things like rivers, creeks, railroads, mines etc. This is a problem inherrent in human society as much as breathing is inherrent in humans. Augusta Kansas in 1998 did everything right and still an "act of god" happen.