In his book, The Closing of the American Mind, Allan Bloom describes his experience teaching a college class at the University of Chicago. Bloom once asked his undergraduate students to identify an evil person. After a long silence it was clear that not one student could do so. These intelligent students could not identify evil. Perhaps the inability to define good and evil is a result of an unclear picture of justice.
The flood narrative of Genesis (chapters 6‒9) is about justice. Approaching the story asking, "Why would a good God destroy so flippantly?" or "What about all the innocent people?" is to approach the text from the wrong perspective. It's not that these questions are inherently wrong, but they aren't asked from the perspective implied by the text itself. The Genesis narrative is clear that the evil of humanity had become all-consuming (6.5‒7, 11‒13). So, God is not destroying flippantly or capriciously. Instead, God is brining justice to the earth. While God's retributive justice is at work so is his gracious mercy in the person of Noah (6.8).
It is important to notice that God's judgment is an outworking of humanity's corruption. The earth was "corrupt" and filled with violence (Gen 6.11‒12). So God determines to "destroy" all flesh (6.13, 17; cf. 9.11, 15). The word for "corrupt" in 6.11‒12 is the same word for "destroy" in 6.13 and 17. The word has an admittedly broad meaning describing everything from the corruption of morality (Gen 6.11‒12; Deut 32.5; Ezek 20.44), "destruction" of semen (Gen 38.9), "corrupting" priestly covenant (Mal 2.8) or even the destruction of a city (Gen 18.28) or king (1 Sam 26.15). Furthermore, the word it is descriptive of God's judgment upon: all flesh (Gen 6.13, 17; 9.11, 15), Sodom and Gomorrah (Gen 13.10; 19.13, 29), Babylon (Jer 51.11) and Tyre (Ezek 26.4). So while the word can be broad, it seems clear that the Genesis narrative is showing God's judgment as the divine response to humanity's already destructive corruption. Basically, God determines destruction as the way humans have already chosen for themselves.
God's redemption, however, is a reversal of this corruption that leads to destruction. The earth is described as being "full" of violence prior to the flood (6.11, 13). The same word is used in the divine command to "fill" the earth in 9.1 which precedes the command for humanity to forsake its violent ways (9.5‒6). Even in light of coming judgment God promises to establish a covenant (6.18) which then becomes the dominant theme of God's blessing to Noah (9.9, 11, 12, 13, 15, 16, 17). So prior to the flood the world is due for destruction via humanity's corruption, but after God's judgment has run its course the earth is poised for production reminiscent of initial creation (1.28‒30) and preservation is divinely assured.
Genesis 6‒9 identifies evil and justice. Evil is humanity gone wrong in violence and destructive living. Justice is God's intention for humanity. Justice requires forsaking the violent corruption of evil and embracing a covenantal relationship with Yahweh. Living justly in a world where evil is rampant isn't easy or simple. It requires a thoughtful engagement with God's revelation. That engagement can be quite difficult. Still, living justly must always be rooted in the covenantal relationship with Yahweh. Otherwise, we will have no idea what justice means. We'll have no idea how to identify evil.