In one verse, it's as if Solomon is saying, "It's all in vain, so why work? Everything you do is just going to be left to someone else, so why bother?" But in the very next verse, he's saying, "It's good for man to labor with his hands and to eat the fruits of his labor." Well, which is it? Can it be both good and in vain? And it's not like this contrast occurs only once. It happens over and over again throughout the book. Please understand, I am not saying that they is a contradiction or any type of error in the Scripture. Any error is on my part, I assure you.
What I am saying is that sometimes Scripture can be confusing, and it's easy to become baffled by its meaning. During these times, the best thing we can do is to compare Scripture with Scripture. We know and understand that it is the perfect Word of God, so it cannot contradict itself. So, when dealing with an unclear passage, it's best to compare it with a clear one. In this case, my mind is drawn back to the book of Ruth, probably because that's where I've been meditating for the past few days.
Then said Boaz unto his servant that was set over the reapers, Whose damsel is this? And the servant that was set over the reapers answered and said, It is the Moabitish damsel that came back with Naomi out of the country of Moab: And she said, I pray you, let me glean and gather after the reapers among the sheaves: so she came, and hath continued even from the morning until now, that she tarried a little in the house. Then said Boaz unto Ruth, Hearest thou not, my daughter? Go not to glean in another field, neither go from hence, but abide here fast by my maidens: - Ruth 2:5-8
In this passage, Ruth is begging for permission to gather up the leftovers after the reapers had finished in Boaz's field. Boaz answers her with a plea of his own, "Stay and work in my field." He goes on to say that she will be protected and provided for and even orders his servants to leave some of "the good stuff" behind for her to gather. It's a beautiful picture of God's provision for us, but I want to focus on Boaz's plea, "Don't leave my field."
Our question with Ecclesiastes is whether it's good to labor or whether it's all in vain. According to this passage in Ruth, it's good to labor. Just as Boaz pleaded with Ruth, so is God pleading with us, "Stay and work in my field." I don't think Solomon was saying that the work was in vain. I believe it's more the motive behind the work. For a man to work to build up a good life for himself, to have riches, to be successful--that is in vain. This life is a vapor, and all that work will be for naught when the man passes away.
To labor in God's field, on the other hand, is never in vain. To work hard to win souls, to encourage the hopeless, to lift up the fallen--this is good, very good. God has given each of us a task to do (actually, many tasks). He has placed us in a field and opened up the opportunities for service. He has provided "the good stuff" for us to glean, but it can only be found in His field. When we leave His field and His service, we're destined for a life that is meaningless. On the other hand, when we allow ourselves to be used of God and continue our labor in His field, we discover those "handfuls of purpose" like Ruth discovered.
There are so many blessings to be had in serving God, but it all boils down to our motive. Are we trying to make a name for ourselves or to lift up the name of the Most High? Are we striving to be successful or faithful? In what field are you serving?