It’s an allegory and it’s pretty packed.
Quite likely arose as answers for the time of archeological finds. Could be echos of Gilgamesh flood which is a far more ancient tale. Could be based on various local floodings that were disasters. [they happen].
In the story, Noah’s a righteous man, the best humanity’s got. Yet, even with that, he too turned out to be flawed. But, that’s all part of the overall narrative: humanity’s screwed up when even the best of the best at the time wasn’t all that great.
Still, the idea of “come here where it’s safe while the world goes to heck” is a powerful narrative and has been used and reused for thousands of years, among religious and non-religious alike.
Where would epic announcer guy be without Noah?
“In a world, where people are stupid and wicked, one man stands alone… with his family. He alone will gather everything non-human. He will allow civilization to be entirely destroyed… in order to save humanity… from itself.”
[yeah I was making noah into a super villain. I gotta watch my humor sometimes.]