King Solomon had everything a human could desire and yet he described the experience as "grazing on wind." Whoever might think that riches, popularity, food, sex, and dancing girls would solve all their problems—ought to read Ecclesiastes. Here is a man who DID have everything and yet he complained with Mick
Jagger, "I can't get no satisfaction."
God used Job to demonstrate how evil in the hand of God can bring one to a greater depth of understanding of God. God used Solomon to demonstrate how all the good in the world will never lead to God without a direct revelation FROM God.
The purpose of both Job and Solomon is to learn their respective lessons so that we don't have to experience the detailed depths of their respective educations.