The narrative purpose of the flood account is actually quite simple. It reminds us of one simple truth of God's character: God is just.
To the Jew for whom this exact version of the narrative is written (I can leave aside Gilgamesh because it differs in thrust), there is one overwhelming truth- God will punish the wicked. In a world where the wicked often seem to prosper, this is too easily forgotten. To say, the Jews of the exile, this is actually a very comforting thought - that even though they may be temporarily defeated (and that happened a lot in Jewish history) God is simply "slow to anger" not completely silent or ineffectual on the matter.
In punishing the wicked, the righteous will be protected. To an enslaved and defeated people, this is good news indeed. There will be an accounting when God's wrath is complete. He is not slow in keeping his promises, as some count slowness to be. Neither is he unconcerned, nor is he Powerless.
Peter (who, it should be remembered, was a Jew) says
if he did not spare the ancient world when he brought the flood on its ungodly people, but protected Noah, a preacher of righteousness, and seven other ... if this is so, then the Lord knows how to rescue godly men from trials and to hold the unrighteous for the day of judgment, while continuing their punishment. (2 Peter 2:5,9)
For the Christian it holds a secondary meaning, namely that God may be love, but he is more than love. God is not just "nice," but he is also just. It is too easy to forget that because God is good, it doesn't mean he can't be powerful too.