The aim of the passage is to cause us to learn how the world was populated by the sons of Noah and their descendants after the flood.
From the beginning, God was the God of all nations and not just Israel.
The following are the nations that descended from Noah’s sons, Shem, Ham, and Japheth, after the flood. The sons of Japheth were Gomer, Magog, Madai, Javan, Tubal, Meshech, and Tiras. The inhabited the coastlands. The sons of Ham were Cush, Egypt, Put, and Canaan. On of the sons of Cush was named Nimrod and he was the first on earth to build a mighty nation. He was wicked and his kingdom started from Babel. He built Nineveh and other great cities. Ham fathered several other nations. The sons of Shem were Elam, Asshur, Arpachshad, Lud, and Aram. It is by the sons of Noah that the whole world was populated after the flood.
Isaiah 56:3-7 Let not the foreigner who has joined himself to the LORD say, “The LORD will surely separate me from his people”; and let not the eunuch say, “Behold, I am a dry tree.” For thus says the LORD: “To the eunuchs who keep my Sabbaths, who choose the things that please me and hold fast my covenant, I will give in my house and within my walls a monument and a name better than sons and daughters; I will give them an everlasting name that shall not be cut off. And the foreigners who join themselves to the LORD, to minister to him, to love the name of the LORD, and to be his servants, everyone who keeps the Sabbath and does not profane it, and holds fast my covenant— these I will bring to my holy mountain, and make them joyful in my house of prayer; their burnt offerings and their sacrifices will be accepted on my altar; for my house shall be called a house of prayer for all peoples.”