The destruction of Jericho, early in the book of Joshua, guarantees for Israel that, in due time, God will give them all the other cities throughout the promised land. Over the course of the book, we see the initial conquest against Jericho filled out with successive conquests against pagans throughout the land.
To rebuild Jericho is effectively to slide all the way back to square one and undo the conquest. I think it is for this reason that Joshua establishes a curse upon the man who dares to rebuild the town:
Cursed by the man before the LORD who will arise and rebuild this town, Jericho. With his firstborn shall he found it, and with his youngest set up its portal. [Joshua 6:26, The Hebrew Bible]
In the book of Kings, as the northern kingdom of Israel falls headlong into apostasy under Ahab, we are told that Hiel the Bethelite undertakes to build up Jericho, and he does it with his firstborn:
At the cost of Abiram his firstborn he laid its foundation and at the cost of Segib his youngest he put up its gates, according to the word of the Lord that He spoke through Joshua son of Nun. [1 Kings 16:34]
It is possible that God directly killed these two sons of Hiel, but as Robert Alter suggests, this might have been a case of an ancient Near Eastern practice of foundation sacrifice. Put another way, the curse might function by means of Hiel’s own depravity: he is so far gone that he voluntarily makes this sacrifice. The people and the land are being re-Canaanitised.
The book of Kings records for us the way in which apostate Israel un-conquers the land, and ultimately un-conquers the city of Jericho. All that Joshua worked towards was undone, until at last it is the Israelites who are conquered by the idol-worshipping Assyrians.