Eccl. 2:26. For to the man who pleases Him God gives wisdom and knowledge and joy; but to the sinner He gives the work of gathering and heaping, only to give to one who pleases God. This also is vanity and vexation of spirit.
He proves that it is a gift of God to be content with the things that are present, for this is given to the man who pleases God with-out any preceding merits. He divides the world into the pious and the impious. In addition to other common gifts, especially wisdom and prudence, joy is conferred on the pious, because they are content with things that are present and are not vexed with thoughts and desires as the impious are. They acknowledge in joy and peace that they are intelligent and wise in administering their affairs. But the impious suffer affliction, so that they continually add more and more, heap things up, and yet are never satisfied. In addition, even if they have wisdom and skill, it is still so mixed with troubles that it becomes more of a punishment for them. They do not enjoy their labors when they till the fields or build, but others enjoy them and get happiness from them. What the impious work at and build is not used rightly by anyone except the pious. Thus what sinners heap up belongs to the pious, because only they use it with thanksgiving and joy, even when they have very little. The impious, on the other hand, for all their anxiety and trouble, do not even use it. In short, the pious truly possess the whole world, because they enjoy it with happiness and tranquility. But the impious do not possess it even when they have it. This is the vanity which the impious possess. (Luther’s Works, v.15 p.47-48)