I am on the Chabad Daily Study of Rambams Mishne Torah.... My rabbi just sent a message on the group forum about these Halachot concerning the sin of idolatry...
Avodah Kochavim - Chapter Two
Halacha 1
The essence of the commandment [forbidding] the worship of false gods is not to serve any of the creations, not an angel, a sphere, or a star, none of the four fundamental elements, nor any entity created from them. Even if the person worshiping knows that ‘ה is the [true] God and serves the creation in the manner in which Enosh and the people of his generation worshiped [the stars] originally, he is considered to be an idol worshiper.
The Torah warns us about this, saying [Deuteronomy 4:19]: "Lest you lift your eyes heavenward and see the sun, the moon, and the stars... [and bow down and worship them], the entities which God apportioned to all the nations." This implies that you might inquire with "the eye of the heart" and it might appear to you that these entities control the world, having been apportioned by God to all the nations to be alive, to exist, and not to cease existence, as is the pattern of [the other creations with] the world. Therefore, you might say that it is worthy to bow down to them and worship them.
For this reason, [Deuteronomy 11:16] commands: "Be very careful that your heart not be tempted [to go astray and worship other gods]." This implies that the thoughts of your heart should not lead you astray to worship these and make them an intermediary between you and the Creator.
Halacha 2
The worshipers of false gods have composed many texts concerning their service, [describing] what is the essence of their service, what practices are involved, and what are its statutes. The Holy One, blessed be He, has commanded us not to read those books at all, nor to think about them or any matters involved with them.
It is even forbidden to look at the image of an idol, as [Leviticus 19:4] states: "Do not turn to the idols." In this regard, [Deuteronomy 12:30] states: "[Be careful]... lest you seek to find out about their gods, saying, 'How did they serve them.' This prohibits inquiring about the nature of their service even if you, yourself, do not serve them. This matter will ultimately cause you to turn to [the false god] and worship it as they do, as [the above verse continues]: "so that I will do the same."
Halacha 3
All these prohibitions have one common thrust: that one should not pay attention to idol worship. Whoever performs a deed that reflects his concern with [idol worship] receives lashes [as punishment].
The worship of false gods is not the only subject to which we are forbidden to pay attention; rather, we are warned not to consider any thought which will cause us to uproot one of the fundamentals of the Torah. We should not turn our minds to these matters, think about them, or be drawn after the thoughts of our hearts.
In general, people have limited powers of understanding, and not all minds are capable of appreciating the truth in its fullness. [Accordingly,] were a person to follow the thoughts of his heart, it is possible that he would destroy the world because of his limited understanding.
What is implied? There are times when a person will stray after star worship, and times when he will wonder about God's oneness: Perhaps He is one, perhaps He is not? [He might also wonder:] What exists above, [in the heavenly realms]? What exists below [them]? What was before time? What will be after time? Similarly, [one might wonder about] prophecy: Perhaps it is true, perhaps it is not? And [one may also wonder] about the Torah: Perhaps it emanates from God, perhaps it does not?
Since he may not know the guidelines with which to evaluate [ideas that will lead him] to the truth in its fullness, he may come to heresy. The Torah has warned about this matter, saying [Numbers 15:39]: "Do not stray after your hearts and eyes, which have led you to immorality" - i.e., each one of you should not follow his limited powers of understanding and think that he has comprehended the truth.
Our Sages [interpreted this warning]: "After your hearts," this refers to heresy; "after your eyes," this refers to immorality. This prohibition - though [severe,] causing a person to be prevented [from attaining a portion] in the world to come - is not punishable by lashes.
Halacha 4
The commandment [forbidding] the worship of false gods is equivalent to all the mitzvot, as [implied by Numbers 15:22]: "Lest you err and not perform all the mitzvot...." The oral tradition teaches that the verse refers to the worship of false gods. Thus, we learn that anyone who acknowledges a false god denies the entire Torah in its totality, all the works of the prophets, and everything that has been commanded to the prophets from Adam, [the first man,] until eternity, as [Numbers 15:23] continues: "...from the day God issued His commandments and afterwards, for your future generations."
[Conversely,] anyone who denies the worship of false gods acknowledges the entire Torah in its totality, all the works of the prophets, and everything that has been commanded to the prophets from Adam, [the first man,] until eternity. [This acknowledgement] is fundamental to all of the mitzvot.
Halacha 5
A Jew who serves false gods is considered like a gentile in all regards and is not comparable to a Jew who violated another transgression punishable by being stoned to death. An apostate who worships false gods is considered to be an apostate with regard to the entire Torah.
Similarly, Jewish minnim are not considered to be Jews with regard to any matter. Their repentance should never be accepted, as [implied by Proverbs 2:19]: "None that go to her repent, nor will they regain the paths of life."
The minnim are those who stray after the thoughts of their hearts, concerning themselves with the foolish matters mentioned above, until they ultimately transgress against the body of Torah [law] arrogantly, with scorn, with the intent of provoking God's anger, and yet say that there is no sin involved.
It is forbidden to talk to them or to reply to them at all, as [Proverbs 5:8] states: "Do not come close to her door." [It can be assumed that] a min's thoughts are concerned with false gods.
Halacha 6
Whoever accepts a false god as true, even when he does not actually worship it, disgraces and blasphemes [God's] glorious and awesome name. This applies both to one who worships false gods and to one who curses God's name [as is obvious from Numbers 15:30]: "If a person commits [an act of idolatry] highhandedly, whether he be a native born [Jew] or a convert, he is blaspheming God."
Therefore, a person who worships false gods is to be hanged, just as one who blasphemes against God is hanged. Both are executed by being stoned to death. Therefore, I have included the laws applying to a blasphemer in Hilchot Avodat Kochavim. Both deny the fundamental principle [of Jewish faith].
Halacha 7
These are the laws which govern a blasphemer: A blasphemer is not liable to be stoned to death until he states God's unique name, which possesses four letters: א-ד-נ-י, and curses that name with one of the names of God which are forbidden to be erased, as [Leviticus 24:16] states: "One who blasphemes God's name...."
One is obligated to be stoned to death for blaspheming God's unique name. [Should he blaspheme] the other names for God, he [transgresses] a prohibition.
There are those who state that one is liable [for execution] only when one blasphemes the name י-ה-ו-ה. I, however, maintain that one should be stoned to death in both instances.
Halacha 8
Which verse serves as the warning prohibiting blasphemy? [Exodus 22:27]: "Do not curse God."
[The procedure for the trial of a blasphemer is as follows:] Each day [when] the witnesses are questioned, [they use] other terms for God's name, [stating,] "May Yosse strike Yosse." At the conclusion of the judgment, all bystanders are removed [from the courtroom]. The judges question the witness of greatest stature and tell him, "Tell us what you heard explicitly." He relates [the curse]. The judges stand upright and rend their garments. They may not mend them [afterwards].
The second witness states: "I also heard as he did." If there are many witnesses, they must all say, "I heard the same."
Halacha 9
[The fact that] a blasphemer retracts his statements in the midst of speaking is of no consequence. Rather, once he utters blasphemy in the presence of witnesses, he is [liable for execution by] stoning.
Should a person curse God's name with the name of a false god, the zealous may strike him and slay him. If the zealous do not slay him and he is brought to court, he is not [condemned to] be stoned. [That punishment is administered] only when one curses God's name with another one of His unique names.
Halacha 10
Whoever hears the blasphemy of God's name is obligated to rend his garments. Even [when one hears] the blasphemy of other terms used to describe God, one is obligated to rend his garments.
The above applies when one hears [the blasphemy] from a fellow Jew. [In that instance,] both one who hears the actual blasphemy and one who hears it from the witnesses is obligated to rend his garments. In contrast, one who hears a gentile [blaspheme God's name] is not obligated to rend his garments. Elyakim and Shevna rent their garments [as described in Isaiah 36:22] only because Ravshakeh was an apostate Jew.
[Before his execution,] all the witnesses and the judges place their hands on the head of the blasphemer and tell him: "You are responsible for your death. You brought it upon yourself." Only a blasphemer - and none of the other offenders executed by the court - has [the judges and witnesses] place their hands upon his head, as [Leviticus 24:14] states: "And all those who hear shall place their hands on his head."