Actually, the original hebrew says the flood covered all the "land", not Earth. That is one of the problems when translating from an acronymic ancient language. The word was "Eretz".
The story is quite similar and probably owes its existence to Sumerian legends, as that is from where the Hebrews originated.
From the tight, ethnocentric view of traditional Judaism, all the people in the world would have been descendants of Noah. To them, gentiles weren't people. Even today, we see this xenophobic attitude in Israel, especially amongst the Harridim.