Avodas Kochavim 2:3
All the prohibitions against idolatry have a common theme: that we should pay no attention to idolatry. If someone performed an action that demonstrated a concern with idolatry, he would receive the penalty of lashes.
The worship of idols is not the only subject to which we are forbidden to pay attention. We are warned against considering any thought that might cause a person to uproot one of the foundations of the Torah. We should not think about such things nor allow ourselves to be drawn after them by our hearts. People generally have limited capacities and not everyone is able to grasp the truth in its entirety. If a person were to follow the thoughts of his heart, he could destroy the world through his limited understanding. Sometimes a person will stray after idolatry; other times he may question God’s unity, asking whether or not He is truly One. A person might also wonder what exists above and below, what came before time and what will be after time. One might likewise question prophecy, wondering whether or not it’s true, as well as Torah, wondering whether or not it truly comes from God. He may not know the parameters within which he might investigate ideas in pursuit of the truth, with the result that he may be led to heresy. The Torah warned us about this, saying, “Do not stray after your hearts and eyes, which cause you to go astray” (Numbers 15:39). This means that each individual should not follow his own limited ability to understand and think that he has managed to grasp the truth. The Sages explained that “after your hearts” refers to heresy and “after your eyes” refers to immorality. This prohibition might cause a person to forfeit his share in the Next World but one is not punished with lashes for its violation.
Avodas Kochavim 2:4
The prohibition against worshipping idols is equal to all other mitzvos, as per Numbers 15:22, “Lest you err and not perform all the commandments….” Our tradition teaches that this verse refers to idolatry. We therefore see that whoever acknowledges a false god denies the entire Torah, the prophets, and everything that has been commanded by prophets from Adam on, as per Numbers 15:23, “from the day Hashem commanded you and on, throughout your generations.”
On the other hand, whoever denies idols confirms the Torah, the prophets, and everything that was commanded from Adam on. This is a major principle of all the commandments.