With the Nephilim out of the way, it’s time to get down to it. The reason behind the flood has been established, that people are wicked and violent (and making Nephilim babies). This clearly indicates that God favors certain behaviors over others.
So here, we have God establishing a baseline for how humanity should behave. Those who do well are spared, and those who do not will perish in the impending flood. Many flood myths define moral behavior, so this is not remarkable for the Bible to do so. However, the moral behavior underlined in the Bible is reinforced much more often. In fact, God has already established moral behaviors previous to the flood. We only need look over what we have so far.
Adam and Eve are presented with the Tree of Knowledge of Good and Evil, and make a choice. When God comes asking, they make a choice. They violated God’s rule in one respect, and had to suffer the consequences for it. In the second instance, they told the truth, demonstrating that they are not completely hopeless.
An examination of Cain and Abel also makes that clear. Murder, violence, lying, and other behaviors are clearly out. This story reinforces the behaviors of Adam and Eve, but show harsh consequences as well. These two stories so close to the creation make it clear that God has a specific moral agenda for humanity, and that their growth depends on this. Without the growth, without choosing to behave in a moral manner, they cannot have access to the Tree of Life.
In Cain and Abel, we have the idea that there may be more people on the planet than previously supposed. Throw this in with the Nephilim, and earth can actually be a pretty crowded place, full of people doing things that God does not approve of. The story of Noah takes place almost 1,000 years after Adam was born, so several centuries have gone by. By this time, people have reproduced sufficiently to form a kind of civilization that makes God regret creating humanity in the first place.