Through his own fault Solomon forfeited the power to perform miraculous deed, which the Divine spirit had conferred upon him. He fell in love with the Jebusite woman Sonmanites. The priests of Moloch and Raphan, the false gods she worshiped, advised her to reject his suit, unless he paid homage to these gods. At first Solomon was firm, but, when the woman bade him take five locusts and crush them in his hands in the name of Moloch, he obeyed her. At once he was bereft of the Divine spirit, of his strength and his wisdom, and he sank so low that to please his beloved he built temples to Baal and Raphan.
The Jebusite Woman Who Led Solomon Into Idolatry
Legends of the Jews 5:93