It is a known fact that King Solomon sinned with his many foreign wives. They influenced him to commit idolatry in the end.
where did you read that , no way did Solomon commit IDOLOTRY. and yes you are right he did sin in the fact that he married Pharaoh's daughter (in order to have Pharaoh as an alliance), but because of that (their is a Midrash) that says that on the day he married Pharaoh's daughter, a read came up which later was the city of Rome ( which brought the galut that we are in right now)
King Solomon starting to worship idols is clearly stated in 1 Kings 11: 1-13. That was the main reason anicent Israel was divided into Northern and Southern kingdoms (with the tribes of Judah and Benjamin in the South).
1Kings.11
[1]Now King Solomon loved many foreign women: the daughter of Pharaoh, and Moabite, Ammonite, E'domite, Sido'nian, and Hittite women,
[2] from the nations concerning which the LORD had said to the people of Israel, "You shall not enter into marriage with them, neither shall they with you, for surely they will turn away your heart after their gods"; Solomon clung to these in love.
[3] He had seven hundred wives, princesses, and three hundred concubines; and his wives turned away his heart.
[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 Ash'toreth the goddess of the Sido'nians, 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.
[7] Then Solomon built a high place for Chemosh the abomination of Moab, and for Molech the abomination of the Ammonites, on the mountain east of Jerusalem.
[8] And so he did for all his foreign wives, who burned incense and sacrificed to their gods.
[9]And the LORD was angry with Solomon, because his heart had turned away from the LORD, the God of Israel, who had appeared to him twice,
[10] and had commanded him concerning this thing, that he should not go after other gods; but he did not keep what the LORD commanded.
[11] Therefore the LORD said to Solomon, "Since this has been your mind and you have not kept my covenant and my statutes which I have commanded you, I will surely tear the kingdom from you and will give it to your servant.
[12] Yet for the sake of David your father I will not do it in your days, but I will tear it out of the hand of your son.
[13] However I will not tear away all the kingdom; but I will give one tribe to your son, for the sake of David my servant and for the sake of Jerusalem which I have chosen."
Only the following Kings of Judah did not worship idols:
Asa (backslid in his last days but never worshipped idols)
Jehosaphat
Uzziah (became a leper finally but never worshipped idols)
Jotham
Hezekiah and
Josiah (Joshiah destroyed the notorious Ashera polls in the high places).
The reforms made by Kings Hezekiah and Josiah delayed the destruction of the southern kingdom for another 133 years.
Kings Amaziah and Joas started well but eventually fell into idolatory.
None of the Northern Kings were loyal to the God of Israel and every one them worshipped idols which led them to Assyrian captivity even 133 years before the Babylonian captivity.
722 B.C.E - End of Northern Kingdom by the Assyrian Empire
586 B.C.E - End of Southern Kingdom by the Babylonian Empire