The 10th prohibition is that we are forbidden from investigating idolatry and looking into its content, i.e. researching and studying the fantasies and foolishness that its founders claim, [for example,] "This spiritual force can be brought down in this way, and then you must do this; this star you must offer incense to, stand before it in this way, and then do this," and so on. Thinking into these matters and investigating these fantasies can cause a foolish person to pursue them and worship them.
The verse which contains this prohibition is G‑d's statement,1 "Do not turn away to false gods." In the words of the Sifra, "If you turn after them, you are making them into gods." There it is written, "Rabbi Yehuda says, 'You must not turn to them [even] to look at them.'" This means that it is prohibited even to gaze at the image's external appearance or to think about how it was made, in order to not spend even a moment of time on them.
In the [Talmudic] chapter "Sho'el adam mei'chavero"2 it is written, "One who walks under an image or statue may not read [their caption] on Shabbat. One may not look at the statue itself even during the week, as the verse says,3 'Do not turn away to false gods.' What does this verse imply? Rabbi Yochanan says [the same words can be read to mean,] 'do not turn away G‑d from your minds.'"4
This same prohibition — to think about idolatry — is repeated in G‑d's statement,5 "Be careful that your heart not be lured away, and you turn astray and worship [them]." This means that if your heart is lured away to think about them, this will cause you to turn away from the straightforward path and become involved in worship. This same concept is repeated,6 "[Be very careful…] lest you raise your eyes to the sky, and see the sun, moon...[and worship them]."This does not prohibit one from lifting up one's head and looking at them with one's eye; rather, it prohibits from pondering in one's mind7 what powers are attributed to them by those who worship them. The same is found in G‑d's statement,8 "[Be careful] lest you try to find out about their gods saying, 'Now, how do these nations worship their gods?'" Even if one does not worship them, it is prohibited to inquire about the nature of their worship since it can cause one to err after them.
You should be aware that one who transgresses this prohibition is punished by lashes.9 It10 has already been explained at the end of the first chapter of Eruvin11 that one is punished by lashes for violating the Biblical prohibition of going beyond the Shabbat limit.12 The Sages prove this by quoting G‑d's statement,13 "A person may not ["al"] leave his place." The Talmud then asks how it is possible to punish with lashes when the prohibition is stated with the word, "al" instead of the word, "lo" ["do not"]. It then answers with the [rhetorical] question, if there are no lashes whenever the word, "al," is used, are there no lashes for the prohibition,14 "Do not ["al"] turn away to false gods?!" This discussion implies that one does receive lashes for this prohibition.