A positive note to start with: the Kohen gadol could enter the kodesh kodashim only one day a year, only on Yom Kippur. This proves the rule, says the Sefas Emes, that b'makom she'ba'alei teshuvah omdim, even tzadikim gamurim ain omdim. On Yom Kippur we are all ba’alei teshuvah. We can enter places and reach heights that are closed off the entire rest of the year.
And now we can get to arayos and idolatry : ) There is one pasuk in the middle of the parsha of arayos that sticks out like a sore thumb: “U’mi’zaracha lo titein l’ha’avir la’molech…” (18:21) Why should the Torah place a warning against molech worship smack in the middle of the discussion of arayos? The Mishna in Megillah (4:9) warns that someone who translates this pasuk as a prohibition against conceiving a child with an ovedes kochavim should be silenced. The rejected reading is obviously an attempt to find a simple solution to the problem of what the pasuk is doing in this context. The Mishna’s admonition notwithstanding, some parshanim (e.g. Abarbanel, Targum Yonasan) accept this reading as pshat. (As to how they deal with the Mishna, see Maharasha, Mahartz Chiyus, Tos Y”T on the Mishna, and my cousin-in-law [is there such a word?] R' Avraham Wagner's sefer Na’ar Yonasan on the Targum. Maybe I don't get it, but I’m not really bothered by this question. Meforshei pshat oftentimes read pesukim counter to the way Chazal do. Just because the Mishna expresses its opposition to this reading so strongly doesn't change anything. The Mishna is speaking l'halacha; the parshanim are talking about pshat -- two very different levels of meaning. To ignore the distinction would lead to things like censoring Rashbam -- who would dare do that? : )
I want to throw out what may be a crazy idea and suggest that there may be a hint to this rejected reading even in Rashi, or to be more accurate, a derash Rashi quotes. While Rashi on the pasuk interprets molech as a form of idolatry, earlier in the perek (18:2) he cites a derasha in the name of Rebbi: “Hashem knew that Bnei Yisrael would violate issurei arayos in the days of Ezra; therefore, the parsha issues a warning in advance, ‘Ani Hashem Elokeichem,’ a judge who will hold you accountable and one trustworthy to reward those who obey.” The Chasam Sofer asks a simple question: what issur of arayos did Bnei Yisrael violate in the days of Ezra? True, in Ezra’s time intermarraige was rampant, but marrying a nochris is not an issur of arayos as listed in our perek! If you accept at least as plausible pshat the reading that the Mishna rejected l’halacha, namely, that the issur molech is a warning against having relations with a nochris and having child, then the Chasam Sofer’s question is moot and Rebbi’s derash makes perfect sense.
Assuming that one takes the Mishna at face value and the pasuk is referring to actual molech worship, how do you explain what it is doing here? R’ Bachyei writes that the covenant between Hashem and Klal Yisrael is like that of marriage. The Torah here is hinting that the sin of avodah zarah is in some sense equivalent to arayos/infidelity. Alternatively, maybe the Torah is reflecting the idea in Chazal that Klal Yisrael engaged in avodah zarah only to allow themselves the opportunity to engage in arayos, not because they were true believers. We also see from the Ba’al Pe’or episode in sefer BaMidbar that the two sins of idolatry and arayos often go together.
The downside of these explanations is that they do not explain why it is molech in particular and not avodah zarah in general that the Torah focusses on. Perhaps there is a relationship between the manner of molech worship and the rationale behind the issurei arayos. Ramban writes that arayos relationships are the result of pursuit of ta'avah and a rejection of the mission of building a family. (This would explain why nidah is mentioned in the parsha even though technically it might not be one of the arayos [see Esvan d’Oraysa]. Ramban writes that relations with a nidah leads to tainted offspring). The worship of molech involved turning over one’s children to the priests of molech to pass them through fire. Just as arayos is, according to Ramban, a forsaking of normal family life for ta’avah, molech also is a sacrifice, in the literal sense, of one’s family, one’s children, for the sake of avodah zarah.