King Solomon certainly had a multitude of flaws, and committed grievous sins against the Most High God. However, YHWH uses even the ungodly for His purposes. He used Solomon to deliver wise counsel to future generations through his writings. If anyone knew what it was like to indulge himself, having anything and everything he desired, it was Solomon. While he is not named directly, he is generally considered to be the author of the Biblical book of Ecclesiastes.
The current generations, both young and old, should take serious note of the message below. How many times have we heard “follow your heart” or let your heart/eyes/desires “be your guide”? Take heed; listen to wise counsel, lest you fall into Adonai’s judgment.
Young person, if you spend your youth only having fun, if you use your early years just to entertain yourself, if you follow your heart as you live your life, and let your eyes be your guide; understand that for all these things God will bring you to judgment. Therefore, remove anger from your heart; and keep from harming your body; for neither adolescence nor youth has any lasting value. So remember your creator while you are young, before the evil days come… ~~ Ecclesiastes 11: 9 to 12:1