This is a story about the emergence of communities that speak different languages and God’s concerns related thereto.
The “whole earth” community (11:1), speaking one language, settles in Shinar (Babylon) and begins a building program. The story reports how this community is broken up and scattered across the landscape; various sub-communities form and over time they learn to speak different languages. This reality is reported (before the fact!) in Genesis 10—the Table of Nations.
Why were they scattered?
The precise nature and purpose of the building program described in 11:4 is unclear. That they are building a high tower does not seem to be a problem. Typical in ancient Babylonian cultures, such towers (with their “top in the heavens”) helped facilitate communication between earth and the gods in heaven. Even the desire for fame (“make a name for ourselves”) does not seem to be a problem by itself. The basic issue seems to be the motivation (“otherwise we shall be scattered abroad”), which corresponds precisely to God’s twice-mentioned judgment (11:8-9); what goes around, comes around.
The issue seems to be the nature of the future they are trying to secure for themselves. They had been charged by God to “fill the earth” (1:28) and “have dominion” (=care for) over it. But here they are focused on preserving their community in isolation from this divine charge: who cares about the rest of the world! In other words “not scattering” (!) puts the rest of the Creation, in biblical terms, is the universe as we know or perceive it. Genesis says that in the beginning God created the heavens and the earth. In the book of Revelation (which speaks of end times) the author declares that God created all things and... at risk. God is concerned that other projects they might devise (11:6) could further threaten the future of “all the earth” (repeated in 11:8-9).
And so God acts in such a way that their languages are confused. Why? This confusion leads to the scattering of the community. God must resist their efforts at unification in order that the charge to “fill the earth” might be fulfilled. God here makes a decisive move on behalf of diversity and difference for the sake of the entire world! God will promote diversity at the expense of any form of unity that seeks to preserve itself in isolation from the rest of creation. God thereby moves toward the fulfillment of the command of A tax collector who became one of Jesus' 12 disciples 28:18-20 to scatter across the face of the earth. True unity is not forged by focusing on unity, but on getting beyond one’s own kind on behalf of the larger world.