Solomon's many wives brought their false gods with them. Eventually Solomon began worshiping these false gods. God told Solomon that when he died his kingdom would be taken away.
4 For when Solomon was old his wives turned away his heart after other gods, and his heart was not wholly true to the LORD his God, as was the heart of David his father.5 For Solomon went after Ashtoreth the goddess of the Sidonians, and after Milcom the abomination of the Ammonites.6 So Solomon did what was evil in the sight of the LORD and did not wholly follow the LORD, as David his father had done.