God gives blessings to those who are good in His sight - Ecclesiastes 2:26
For God giveth to a man that is good in his sight wisdom, and knowledge, and joy: but to the sinner he giveth travail, to gather and to heap up, that he may give to him that is good before God. This also is vanity and vexation of spirit.
Solomon gave an observation about a general principle in life – God rewards righteousness and punishes sin. To an individual who pleases God, He gives wisdom, knowledge, and joy. But to the habitual sinner, He gives the burden of hard work, accumulating and piling up, only to see it taken over by someone who strikes God’s fancy.