Upon arriving in Eretz Yisrael, Am Yisrael are commanded: “You shall completely destroy all the places where the nations which you are taking over worshipped; their gods on the high mountains and hills, and beneath every lush tree. You shall demolish their altars, smash their altar blocks, burn their ashera-trees in fire, cut down their idolatrous statues and obliterate their name from that place” (Devarim 12/2-3). We are expected as one of the positive commandments “To destroy their houses of worship in all forms of destruction… each according to what is appropriate for its type to expedite its destruction”(Sefer Hachinuch 436).
In contrast, we are immediately taught “Lo ta’asun ken lahashem elokeichem” (Devarim 12/4), You must not do so to Eternal your God. This pasuk teaches the negative commandment “To refrain from obliterating the holy books and the names (of God) written there and places of holy worship”(Sefer Hachinuch 437).
This latter mitzvah may be transgressed in three different ways. One is erasing the name of God written anywhere. The second by destroying even partially the altar or parts of the Azarah and Heichal (Sections of the Mikdash where the altar stood or those of greater sanctity.) The third is by burning logs designated for use in the Mikdash. A person who does any of these actions transgresses the prohibition and receives forty lashes (see Rambam Hilchot Yesodei Hatorah ch 6 halachot 1,7).
Rav Yosef Babad (1801 – 1874) in his Minchat Chinuch goes a step further stating that each of the above forms of obliterating kedusha stand on their own. Consequently, if one were to erase the name of God, demolish a part of the Mikdash and burn wood designated for the Mikdash he would receive three sets of lashings. He explains that even though all are an expression of the same mitzvah, they are, in fact, independent forms of that prohibition. Consequently, there are separate lashes for each.
In Mashechet Shevuot (35a), we find a berayta that identifies the names of God that may not be erased. Though it is commonly agreed that there are seven names included in this list, there are several differing versions and readings of the berayta that lead to somewhat differing opinions as to which names are included in this list. An interesting debate is whether the name Yude heih vav heih and the name Adonay are counted as one name or two independent names. While the Rambam in Hilchot Yesodei Hatorah (ch 6 halacha 2) sees these two forms of writing as alternate forms of the same name, the Sefer Hachinuch and others list them as two independent names.
Another interesting question in reference to this prohibition is what the status of destroying books that contain words of Torah but not the name of God is. It would seem that the question hinges on how we understand the first mishna in the sixteenth chapter of Masechet Shabbat. The mishna teaches that “Holy scriptures may be saved (on Shabbat) from being burnt in a fire… and require (when not useable) geniza (burial)”. There is a debate whether this mishna is interpreting the biblical prohibition of “Lo Ta’asun ken lahashem”, extending the prohibition beyond the formal names of God, or presenting a rabbinic expansion of that prohibition.
The Rambam in Hilchot Yesodei Hatora (ch 6 halacha 8) writes: “The Holy Scriptures, they and their commentaries may not be burned or destroyed by hand and he who destroys them receives lashings of coercion (lashings given to those who refuse to abide to rabbinic decrees)”. Yet, in Sefer Hamitzvot (prohibition 65), he writes that we are prohibited from destroying books of prophecy and from erasing the holy names. Since he mentions books of prophecy and the names of God, we find that regardless of the name of God, destroying a book of holy content, is a biblical prohibition. However, the Magen Avraham (OC 154/9) takes the position found in the Rambam’s Sefer Hamitzvot, and concludes that all books of Torah are included in the biblical prohibition of “Lo Ta’asun Ken Lahashem”. Other commentaries (see Avodat Hamelech, Yesodei Hatorah 6/8) disagree and conclude that we should rule, as the Rambam ruled in Hilchot Yesodei Hatora, that the broader prohibition of destroying holy books is a rabbinic extension of the biblical prohibition.