The Flood was like a drastic, last-ditch medical therapy that kills off a disease, but nearly kills the patient in the process.
Throughout Scripture, states of uncleanness can only be remedied by repentance, water, and time. Since there was no repentance coming from the people who lived before the Flood, God repented himself from having made them, and then he sent water and time to cleanse the earth from the uncleanness of their depravity.
The chiasm in this passage separates the death of all living things from the rest of the passage by two literary walls of water. The first wall is measured by depth, the second by time.