http://revach.net/article.php?id=3701

Section: Parshas HaShavua   Category: Quick Vort
Parshas Kedoshim: The Alter Of Slabodka - Why Blame Shlomo HaMelech For Avodah Zara?
The Gemara in Shabbos (56) says that although the pasuk seems to imply that Shlomo HaMelech worshipped Avodah Zara, in truth it was his wives whom he did not rebuke, and therefore, he was held accountable.

The MiShulchan Govoa brings that the Alter of Slabodka asks, "If his aveira was not rebuking, then he was oveir the obligation of Hochei'ach Tochiach (Kedoshim 19:17).  Why does the pasuk say avoda zara?"  He answers that when a person sees an aveira, it makes a subconscious impression on him.  The way to rid himself of this unnoticeable stain, is to stand up and oppose the action verbally.  If he does not, then over time these repeated visions will lead him to also do this aveira.

Shlomo HaMelech, by not protesting his wives behavior after witnessing it, left himself vulnerable to Avoda Zara.  While on the surface his aveira was Hochei'ach Tochiach, deep within his neshama he had the stain of avoda zara.