Solomon deliberately views life through the eyes of the unbeliever who sees nothing beyond the chaotic appearance of things in this world. On earth there is vanity.
When the wicked see that faith does not render a person immune from the common trials of mankind, they see no advantage for the flesh, and lose all carnal motives for coming to God. God indeed hides himself from the unbeliever for they wanted God out of their lives and so he gives them what they wanted and withdraws his government from their sight. What they are left with is a meaningless world where sight is blind. This world is a poor reward for the unbeliever. It is a sore trial that God has inflicted on mankind. It is as if he has removed all incentive for loving the present life, and cursed this world because he knows our tendency to make an idol of it. Why give ourselves to a world which is in such a state of confusion?