I struggled for six years with Romans 2:5-8.
But according to your hardness and unrepentant heart you are treasuring up for yourself wrath in the day of wrath, revelation, and of the righteous judgment of God; who “will pay back to everyone according to their works:”to those who by perseverance in well-doing seek for glory, honor, and incorruptibility, eternal life; but to those who are self-seeking, and don’t obey the truth, but obey unrighteousness, will be wrath, indignation<
(Don’t dismiss this passage; Gal. 6:7-9 says the same thing with the Holy Spirit included.) The following quote from an anonymous letter to someone named Diognetus, written in the first half of the second century, brought the revelation I needed to understand it.
As long then as the former time endured, He permitted us to be borne along by unruly impulses, being drawn away by the desire of pleasure and various lusts. This was not that He at all delighted in our sins, but that He simply endured them; nor that He approved the time of working iniquity which then was, but that He sought to form a mind conscious of righteousness, so that being convinced in that time of our unworthiness of attaining life through our own works, it should now, through the kindness of God, be vouchsafed to us; and having made it manifest that in ourselves we were unable to enter into the kingdom of God, we might through the power of God be made able. (ch. 9)
This made me realize that Jesus did not die to eliminate the judgment by works. He died to empower us to face the judgment by works. (“Having made it manifest that in ourselves we were unable to enter into the kingdom of God, we might through the power of God be made able.”)
This simple interpretation explains the many verses that say Christians will be judged by our works (e.g., Matt. 25:31-46; 2 Cor. 5:10; 1 Pet. 1:17; Rev. 3:1-5). Nonetheless, it is generally rejected because of the false teaching that God will demand sinless perfection at the judgment. Yes, James 2:10 says that we should not judge others who have broken the law because we are lawbreakers as well, but the verse does not say God judges that way.
Ezekiel 18:20-30 explains how God judges (in complete conformity with the New Testament verses I already mentioned.) The Ezekiel passage is a dissertation by God against Israel explaining how he judges and why his judgment is just. Romans 2:5-8 agrees with it.
Here is the real standard of God’s judgment: “He has shown you, O man, what is good, and what the Lord requires of you: but to do justice, to love mercy, and to walk humbly with your God” (Micah 6:8)
You will find other passages that clarify that giving to and taking care of widows, orphans, and the poor as well as not loving this world are also required (James 1:27). All that God requires, though, is attainable to those who have received the power of God through Jesus Christ. Christians have received grace, and because of this sin does not have power over them (Rom. 6:14; Gal. 5:24). God has given us “everything that pertains to life and godliness” (2 Pet. 1:3).
Why would it be wrong then, that God require of those so empowered and delivered from the corruption that is in the world through lust (2 Pet. 1:4) that they not be entangled in it again and overcome? (2 Pet. 2:20-21). This is especially true if they are also offered ongoing forgiveness for sin when they stumble (1 Jn. 1:7-2:2).
The rest of ch. 9 of the anonymous letter to Diognetus praises God for the substitutionary atonement of Jesus Christ. Do not confuse this with our version of the atonement, though. You must go on to chapter 10 and read that which must be the result of his love and grace.”