Why did God allow Solomon to have 1,000 wives and concubines?

 
Why did God allow Solomon to have 1,000 wives and concubines? What does the Bible say about king Solomon’s wives? Is Polygamy a sin?
SOURCE: Got Questions Ministries - https://www.youtube.com/@gotquestions