This is from 1 Kings 11
Solomon had a great legacy, particularly his wisdom. Indeed, the only one that came to Earth, at least that the Bible mentions, that had greater wisdom than Solomon was Christ Himself! However, despite his wisdom, Solomon did some very foolish things.
It was his wives that brought him away from God. (Speaking of wives, I get that Solomon may have had some bad experiences with women. He commented that it would be better to live in a corner of a rooftop than in a huge house with a mean and irritable woman.) Against God’s command, he married foreign women (On a side note, polygamy always brings problems, as can be seen throughout the Bible.) He wanted to appease them (which is all fine and good, in and of itself), but the thing is, they worshipped foreign gods (i.e. the idol kind with horrific worship practices.) Some of these idols (like Molech for instance) involved human sacrifice.
God was furious at Solomon’s actions. He told Solomon that he was going to take the kingdom from him. However, for the sake of his father David, God would not take it during Solomon’s life, and, even after, wouldn’t take all of it.
(It should be mentioned here, before the closing paragraph, that Solomon repented sometime before his death. His “vanity, vanity, all is vanity” in Ecclesiastes shows that he did see the error of his ways. )
If Solomon hadn’t married the wrong people, then he wouldn’t have fallen into idolatry. If he hadn’t fallen into idolatry, the Divided Kingdom wouldn’t have happened and history would have been VERY DIFFERENT! Also, his son Rehoboam may have been a good king rather than a bad one. Be sure you are marrying in God’s will so that you don’t make the mistake of Solomon and be lead away from God by your spouse!