…it shall not be rebuilt. (Deuteronomy 13:17)
Once eradicated, the ir hanidachas – the city the majority of whose residents have been led astray into idolatry – may not be rebuilt. The land may be used for planting but not for houses.
The reason is similar to what we said in the obligation to destroy such a city: it was so thoroughly-riddled with idolatry that its legacy deserves to be destroyed. Just like someone might think twice before moving to a city called “New Sodom,” there should be no interest in reviving a city destroyed for idolatry.
This mitzvah only applies at a time when the Jews reside in their land and there is a functioning Sanhedrin. It is discussed in the Talmud in the tractate Sanhedrin on page 111b. It is codified the Mishneh Torah in the fourth chapter of Hilchos Avodas Kochavim. This mitzvah is #23 of the 365 negative mitzvos in the Rambam’s Sefer HaMitzvos.