The original Genesis passage quoted occurs in the context of God and Abram discussing God's promises for him:
"The Lord said to him, “I am the Lord who brought you out from Ur of the Chaldeans to give you this land to possess.” But Abram said, “O sovereign Lord, by what can I know that I am to possess it?” - Genesis 15:7-8 (NET)
Next begins a covenantal ritual between Abram and God, and the dream you're asking about occurs in between Abram setting up the ritual and God confirming it. The 'slavery' is foretold in the context of a proviso for God's promise to come to pass, rather than being explained as a punishment.
The enslavement of Israel in Egypt is nowhere depicted as a 'punishment' in the Bible, as far as I am aware, but rather something of a necessary trial planned for them. For Abraham, it was remarkable that his offspring should be made a nation, and to be given such a vast tract of land for his descendants - and God promises that a great nation will result, but that along the way there will be trouble:
Then the Lord said to Abram, “Know for certain that your descendants will be strangers in a foreign country. They will be enslaved and oppressed for four hundred years. But I will execute judgment on the nation that they will serve. Afterward they will come out with many possessions. But as for you, you will go to your ancestors in peace and be buried at a good old age.
"In the fourth generation your descendants will return here, for the sin of the Amorites has not yet reached its limit.” When the sun had gone down and it was dark, a smoking firepot with a flaming torch passed between the animal parts. That day the Lord made a covenant with Abram: “To your descendants I give this land, from the river of Egypt to the great river, the Euphrates River— the land of the Kenites, Kenizzites, Kadmonites, Hittites, Perizzites, Rephaites, Amorites, Canaanites, Girgashites, and Jebusites.” - Genesis 15:13-19
The first stated intention for the slavery in Egypt to happen is that the descendants would 'come out with many possessions' (v14), and this seems to be phrased in a positive light and not a negative one. The language of the passage doesn't obviously infer the events as a punishment.
The second stated intention is 'for the sin of the Amorites has not reached its limit', and in quick succession God lists ten tribes who currently inhabit said land. Abraham's people were to inhabit the land, but not for a long time, in such a time as it would be right for them to seize it.
Another angle on your question is to therefore ask why Abraham's descendants should be in another land until it is right for them to take the land. An inference of the text might be that Abraham will live in safety in the land, but for a period of time his descendants are not to have their own land. And if they aren't land-owners, they are necessarily nomads or slaves. In order for God to bring them into the land to take hold of it at the right time, the people must be put into an uncomfortable situation to prepare them for God's promises.
This fits well with the language Deuteronomy uses to discuss their place of slavery, and then Jeremiah by extension:
"You, however, the LORD has selected and brought from Egypt, that iron-smelting furnace, to be his special people as you are today." - Deuteronomy 4:20 NET
"Tell them that the Lord, the God of Israel, says, ‘Anyone who does not keep the terms of the covenant will be under a curse. Those are the terms that I charged your ancestors to keep when I brought them out of Egypt, that place which was like an iron-smelting furnace." - Jeremiah 11:3-4