Here is how I understand the narrative.
As you noted, the function of ziggurats in the ancient world was to facilitate a deity coming down from heaven and dwelling with people. This was a good deal for the deity because they were believed to have needs like clothing, food, and a place to sleep, which the people were offering to attend to. This was a good deal for the people because if the deity lived among them they could expect blessings and protection.
So when the people of Babel decided to approach Yahweh the way they approached pagan deities by building a ziggurat, they were showing that they thought God could be manipulated to serve their goals to make a name for themselves in the world. They were assuming God had needs that they could meet. So, God decided to correct their misunderstandings by thwarting their attempts to approach him in an unsanctioned way and attempting to control his blessings.
The narrative of the Tower of Babel immediately precedes the narrative of God’s covenant with Abraham and there are some interesting parallels. Instead of the people deciding to make a name for themselves by using God, God promises to make a name for Abraham. Instead of hunkering down in once place, Abraham is sent out from his home and promised that not just he and his land will be blessed, but all the people of the earth will be blessed through him. The Abrahamic covenant is a crucial key to understanding the entire story of redemption presented in Scripture, and the Tower of Babel forms a foil and a contrast for the covenant story.