In chapter 2, Solomon launches into what he had learned about his works of building material things like houses and gardens and seeking even greater wealth. His conclusion? All of these material achievements were nothing but vanity, a grasping after wind.
He finds no real, sustained profit in them, nothing that truly added to his quality of life, no lasting fulfillment. He does not mean they resulted in no sense of achievement or passing pleasure, but that their fruit never truly fulfilled God's purpose for man. Therefore, those things are poor substitutes for a sustained sense of well-being. He then proceeds into an exploration of wine and entertainment. These are simply another form of materialism, ways of pleasing the flesh. He concludes that they, too, are folly, a mad pursuit.
John W. Ritenbaugh
Ecclesiastes and Christian Living (Part Seven): Contentment
Solomon, knowing the human condition was a result of God's purpose, reveals that men can receive something good from his toilsome lot. Verse 26 lists three virtues we can derive from our labors: "For God gives wisdom and knowledge and joy to a man who is good in His sight; but to the sinner He gives the work of gathering and collecting, that he may give to him who is good before God."
A person who combines his work with a relationship with God will receive growth in character! On the other hand, a sinner, cut off from God, must endure the drudgery of the struggle, and the rewards of his work would eventually benefit the righteous, not himself!
Richard T. Ritenbaugh
The First Prophecy (Part Three)
Other Forerunner Commentary entries containing Ecclesiastes 2:22: