“This is an evil in all that is done under the sun, that the same event happens to all. Also, the hearts of the children of man are full of evil, and madness is in their hearts while they live, and after that they go to the dead…Again I saw that under the sun the race is not to the swift, nor the battle to the strong, nor bread to the wise, nor riches to the intelligent, nor favor to those with knowledge, but time and chance happen to them all.”
— Ecclesiastes 9:3,11 ESV
In these verses, Solomon is not accusing God of being evil. Rather, he is saying that the fairness we are all subjected to in this life is evil. That it doesn’t matter if one is righteous or unrighteous death, time, and chance “happen to them all.” Instinctively, our conscience screams, “That’s not fair!” and demands a just order to the world. But fairness is an evil consequence of the Fall. God wants us to live in a just world. It was this way in the beginning, and it will be this way again in the end. He will re-establish the correct order of creation one day where justice, not fairness, rules; where the same event does not happen to all. The unrighteous will be punished, and the righteous will be rewarded.
This is why, in His wisdom, God gave us the law: to provide a standard for just living, and to give a foretaste of what life within a just world could be like (if everyone obeyed). But sin takes the opportunity to arise in our hearts once the Law is given (Rom 7:8). To establish a just world, He can not only teach us and leave us to our own free will. He must also redeem us from the madness that is in our hearts by giving His life in place of ours. Therefore, first God establishes the standard of justice, then He exercises through Christ the first perfectly just act by any human being. “For our sake he made him to be sin who knew no sin, so that in him we might become the righteousness of God.” (2 Cor 5:21).
Christ’s perfect obedience secures the promise that one day we will escape life in this fair world, where “the same event happens to all,” and enter into life within a just world. Here, the unrighteous will receive their punishment but the man no longer tainted with sin will discover that God will withhold no good thing from him (Ps. 84:11). In this just world, every good thing is an expression of God’s self and results in the righteous man’s exultation in the unblemished, holy character of God. It is a self-reinforcing, self-sustaining relationship dynamic wherein God continuously blesses, and man continuously rejoices. For man’s joy will no longer be in the gifts that he receives but in the goodness, and the justice, of the God who gives.