The Problem of the Virtuous Pagan
We have as our lawgiver the true God, who teaches us to practice righteousness, to be pious, and to do good.
What about non-Christians who display virtue? Do their “good works” earn any merit before God? To answer this question we must first discover what God considers a "good" work.
According to the Scriptures, for any work to be considered good (morally right before God), the person committing the act must be doing so with the right goal in mind, with the right motive, and according to the right standard.
The right goal
The act must be done to God’s glory.
Q. What is the chief end of man?
A. The chief end of man is to glorify God and to enjoy him forever.
Westminster Shorter Catechism (1642-1647)
Whether, then, you eat or drink or whatever you do, do all to the glory of God.
1 Cor. 10:31
And it must be done in service to the Lord.
Whatever you do, do your work heartily, as for the Lord rather than for men
The Right Motive
The act must be done in true faith.
Q. What is true faith?
A. True faith is not only a sure knowledge whereby I hold for truth all that God has revealed to us in His Word, but also a hearty trust, which the Holy Ghost works in me by the Gospel, that not only to others, but to me also, forgiveness of sins, everlasting righteousness, and salvation are freely given by God, merely of grace, only for the sake of Christ's merits.
Heidelberg Catechism (1563)
But he who doubts is condemned if he eats, because his eating is not from faith; and whatever is not from faith is sin.
And it must be done in love.
If I have the gift of prophecy, and know all mysteries and all knowledge; and if I have all faith, so as to remove mountains, but do not have love, I am nothing.
And if I give all my possessions to feed the poor, and if I surrender my body to be burned, but do not have love, it profits me nothing.
1 Cor. 13:2-3
The Right Standard
It must be according the right standard—God’s law.
What shall we say then? Is the Law sin? May it never be! On the contrary, I would not have come to know sin except through the Law
My best work on my best day is defiled by sin. It's only because I stand in the shadow of the cross that I am able to bring anything before the Lord. It’s only because I'm clothed in a righteousness not my own.
But now apart from the Law the righteousness of God has been manifested, being witnessed by the Law and the Prophets, even the righteousness of God through faith in Jesus Christ for all those who believe; for there is no distinction
Q. But why cannot our good works be the whole or part of our righteousness before God?
A. Because the righteousness which can stand before the judgment seat of God, must be perfect throughout and entirely conformable to the divine law, but even our best works in this life are all imperfect and defiled with sin.
Heidelberg Catechism (1563)
This is the answer to the Problem of the Virtuous Pagan: Neither his works nor mine are acceptable apart from Christ. For it is only in Christ that those works can be considered good—being done towards the right goal, for the right reasons, and according to the right standard.