As Bnei Yisrael prepared to enter Eretz Yisrael, they were commanded: "Destroy all of the places that the nations worshipped their gods ... You shall smash their altars and break their monuments, and the idols of their gods you shall destroy and erase their name from that place. Do not do so to Hashem, your G-d" (Devarim 11:31,12: 2-4). What is the meaning of this last command not to do so to Hashem, and why would one think to do so?
Unkelos translates the verse: "Do not worship so before Hashem." In other words, Bnei Yisrael were told not to implement pagan practices in serving Hashem, which is certainly a logical command. The textual problem is, though, that "do not do so" follows the command to destroy the pagan gods, not the description of their worship.
Rashi brings three explanations. The first is, do not bring sacrifices to Hashem any place you desire, as it says in the following pasuk. The difficulty with this explanation is that the phrase in question implies strongly that it refers to that which precedes, not that which follows (see Ibn Ezra and Rashbam).
Another explanation, brought in R. Yishmael’s name, is that we should not cause our altars and Temple to be destroyed, which could happen if we act like the pagans. This is not the pasuk’s simple meaning, but let us mention a beautiful idea of the S’fat Emet in this regard. The Torah continues, "you shall seek His Presence." The inverse of R. Yishmael’s warning is that by seeking out the Mikdash even when it is destroyed, one causes it to be more speedily rebuilt.
Rashi’s third explanation is that while destroying the signs of worship, we should not destroy articles used for worship of Hashem or that include His Name. This fits the wording and sequence of the p’sukim, but it is still difficult to explain why one would think to destroy that which is Hashem’s.
Let us describe the background whereby one might think to destroy a Jewish altar. Upon returning to the Land of the Forefathers and their followers, Bnei Yisrael would encounter altars from the patriarchs’ time. Paradoxically, it was forbidden to use some of them and, at certain times, any of them. That is because matzeivot (monuments) became forbidden at Sinai and because all altars were forbidden when there was a central place of worship in Shilo and later in Yerushalayim. So what were Bnei Yisrael to do with the unusable, sacred altars and monuments? One might have thought to destroy them. Therefore, the Torah tells us that since they were associated with service of Hashem, one would have to dismantle them, while preserving their sanctity, and bury their components. The fact that this was a difficult undertaking would explain why it is was so hard to root out the forbidden use of extra-mikdash altars throughout the time of the first Beit Hamikdash. Indeed the bamot were a major problem until King Yoshiyahu took steps against them.