I don’t think that God deliberately caused the flood. Only in the last few hundred years have people thought in terms of secondary causes. For instance, when the English amazingly defeated the Spanish Armada and effectively assured its tot al destruction by forcing them to sail round the north of Scotland, the English ascribed the result to God; the Spanish attributed it to better seamanship of the English.
I talk about this in my essay “The Meaning of Job” which is in my “Job for Public Performance”. (I suggest you buy it on Kindle).
So in the Bible they do not look for explanations, they look for meaning, usually the wickedness of the people concerned. Where a remnant survive, that gives a further meaning, as in the establishment of the state of Israel after the Holocaust. But like everything else, history is written from the viewpoint of the winners (Israelis), not from the viewpoint of the losers (Palestinians).