In Romans 7 Paul is explaining a spiritual truth about our nature and that by nature we are sinful.
Sin is anything that is in opposition to God and by our nature we are inclined to be in opposition to God. Our ways value things that humans do and by our nature we do what is good through human understanding.
But Paul writes that we cannot do anything good because we are by nature in opposition to God (Romans 7:14-24).
This is why the commandments, called the law, were given. They were given to show us what God desires (Romans 7:13).
The law was given so that we would recognize when we were in opposition and instead do what God desires.
Paul explains that our sinful nature is also a law and only recognizes things that oppose God (Romans 7:13). The law’s commandments provided a way to remove the consequences of sin but could not deliver us from the desire to follow our sin nature which is anything that is in opposition to God.
In this way, we are held captive to our nature of being in opposition to God. We can recognize sin but cannot oppose it and are condemned by the law’s commandments to die for our sin and condemned by sin to always be in opposition to God (Romans 7:13-24).
But God has delivered us through Christ Jesus from the power of our sin nature and from the condemnation of the law. He has delivered us from our sin nature through his death.
Paul writes that because Jesus died and was righteous, meaning not in opposition to God and blameless, the requirement of the law that required death for sin was met. And because God raised Jesus from the dead a new law was established so that there is:
The law of our sinful nature that puts us in opposition to God,
The laws of the commandments that show us what pleases God but also condemns us because we cannot please God though our sinful nature and,
The law of the Spirit that gives life (Romans 8:1-4).
And it is this law of the Spirit that was established through Jesus’ death and resurrection that frees our minds from our natural desire to be in opposition to God and to understand what God desires.
God desires righteousness. We who believe that Jesus’ sacrifice makes us righteous before God, receive this righteousness (Romans 8:1-4).
God desires to give life. We who believe that Jesus’ sacrifice gives us a new way to live are no longer governed by our sinful nature that opposes God but by his Spirit that brings life and peace (Romans 8:6-11).
God desires reconciliation of humanity back to him. We were once disconnected from God because our nature would not allow us to recognize God. Paul writes, “For I know that good itself does not dwell in me, in my sinful nature. For I have the desire to do what is good but cannot carry it out” (Romans 7:18). The mind governed by what is in opposition to God is death, but the mind governed by the Spirit is life and peace. The mind governed by the flesh is hostile to God, it does not submit to God’s law, nor can it do so. Those who are in the realm of the flesh cannot please God (Romans 8:6-8).
But the Spirit of God that has been given through Jesus reconnects us back to God who is good and makes us children of God and co-heirs with Christ Jesus “who gave himself for our sins to rescue us from the present evil age, according to the desire of our God and Father” (Romans 8:14-17; Galatians 1:4).