The Bible makes it clear why God destroyed mankind with a flood. Here is what the complete, inspired and inerrant word of God says:
“And God saw that the wickedness of man was great in the earth, and that every imagination of the thoughts of his heart was only evil continually. And it repented the LORD that he had made man on the earth, and it grieved him at his heart. And the LORD said, I will destroy man whom I have created from the face of the earth; both man, and beast, and the creeping thing, and the fowls of the air; for it repenteth me that I have made them” (Genesis 5:5-7, KJV, highlights my own).
After the flood, God promised that that he would never again destroy every living thing, and this is the reason He gave:
“And the LORD smelled a sweet savour; and the LORD said in his heart, I will not again curse the ground any more for man's sake; for the imagination of man's heart is evil from his youth; neither will I again smite any more every thing living, as I have done. While the earth remaineth, seedtime and harvest, and cold and heat, and summer and winter, and day and night shall not cease” Genesis 8:21-22, KJV, highlights my own).
So let's see if I have this right: God repented that He made mankind, and He destroyed them – men, woman and children - because “the wickedness of man was great in the land, and every imagination of the thoughts of his heart was evil continually. Then the omniscient Creator promised never to do it again and the reason He gave was the very same reason He gave for destroying them to begin with: because “the imagination of man's heart is evil from his youth.” The reason the Almighty gave for destroying mankind was the same reason He gave for promising never to do it again. It seems that the God who changeth not is guilty not only of repenting, but also repenting of repenting.
Did God really feel that evil would vanish if He destroyed everyone on the Planet but Noah and his family? Guess what, He was wrong! Well, I suppose that even God is entitled to at least one mistake.
It's just a shame that so many people had to be drowned for God to realize the error of His ways.
The ultimate immorality is the unnecessary taking of human life. But I suppose that it's not really considered murder when God does it.