If you were to read again the beginning of Romans 7, the context or framework is the Old Law.
#1. “…brethren, (for I speak to them that know the law,)” (Romans 7:1).
#2. “we should serve in newness of spirit, and not in the oldness of the letter.” (Romans 7:6).
Therefore, the struggle Paul is talking about in Romans 7:14-24 is in reference to his time when he was Saul in the false Pharisee religion under the 613 Laws of Moses. Paul was sinning or in the flesh because he was wrongfully under the Old Law.
Some quick points to consider:
#1. Christians cannot be justified by the Laws of Moses (Acts 13:39).
#2. Gentile Christians were told by the Jerusalem council that they did not have to keep the Laws of Moses as a whole (Acts 15:5) (Acts 15:24).
#3. The Law has changed (Hebrews 7:12).
#4. The temple veil was torn from top to bottom letting us know that the Law and the priesthood had ended (Matthew 27:51).
#5. Jesus said that the cup of the fruit of the vine represented the blood that would be shed for the New Testament (Luke 22:20).
#6. Jesus‘ death starts the New Covenant (For a testament is not in force unless the testator dies - Hebrews 9:16-17).
So when Paul talks about being ”in the flesh” in the next chapter (Romans 8) he is referring to how one seeks to be justified by the keeping of the Old Law (Which is no more) (Like keeping circumcision, dietary laws, sabbaths, holy days, etcetera).
Galatians 4:9-11
9 “…whereunto ye desire again to be in bondage?
10 Ye observe days, and months, and times, and years.
11 I am afraid of you, lest I have bestowed upon you labour in vain.”
As we can see in this above passage, Paul was afraid for the Galatian believers because they were keeping days, months, and years (Which is the keeping of the ceremonial days exclusive to the Laws of Moses, i.e. the Old Law).
“Christ is become of no effect unto you, whosoever of you are justified by the law; ye are fallen from grace.” (Galatians 5:4).
Paul was saying this because people were thinking they had to be circumcised to be saved.
Acts 15:1
”And certain men which came down from Judaea taught the brethren, and said, Except ye be circumcised after the manner of Moses, ye cannot be saved.”
Galatians 5:2
”Behold, I Paul say unto you, that if ye be circumcised, Christ shall profit you nothing.”
Circumcision was given to Abraham and his people and it was given to those under the Laws of Moses.
Circumcision was not given to us by Jesus and His followers.
In Romans 7:14-24: Paul wanted to keep the “
righteousness of the Law” (or the righteous aspect or part of the Old Law) (Like do not steal, do not covet, etcetera), but he was unable to do so because he was wrongfully under the Old Covenant Law system as a whole (Instead of being under the New Covenant way).
Romans 8:2 says:
“For the law of the Spirit of life in Christ Jesus hath made me free from the law of sin and death.”
Two laws are mentioned in this verse above here.
#1. The Law of the Spirit of Life in Christ Jesus (i.e. New Covenant Law), and:
#2. The Law of Sin and Death (Old Covenant Law or the Laws of Moses).
Note: It’s called the Law of Sin and Death because you could be put to death physically for disobeying certain aspects of the Laws of Moses (Which is not the case with the laws of Christ because Christians are to love their enemies and not stone them with physical death).
Romans 8:4 says:
”That the righteousness of the law might be fulfilled in us, who walk not after the flesh, but after the Spirit.”
We have to walk after the Spirit (Which is only made possible after one accepts Jesus Christ as their Savior and or they believe the gospel message in 1 Corinthians 15:1-4, and they then seek to obey the commands that come from Jesus and His followers in the New Testament).
One way the righteousness of the Law can be fulfilled by walking after the Spirit is by doing the following…
Romans 13:8-10
8 “Owe no man any thing, but to love one another: for he that loveth another hath fulfilled the law.
9 For this, Thou shalt not commit adultery, Thou shalt not kill, Thou shalt not steal, Thou shalt not bear false witness, Thou shalt not covet; and if there be any other commandment, it is briefly comprehended in this saying, namely, Thou shalt love thy neighbour as thyself.
10 Love worketh no ill to his neighbour: therefore love is the fulfilling of the law.”
New Covenant loving (like helping your brother in need, or helping the poor with a pure heart of love) fulfills all the requirements of the Old Law (Even though the Old Law is technically no more). In other words, if one wants to keep the Old Law, the only way to do it today (Because we are under the New Covenant) is by loving your neighbor and not by keeping all 613 Laws of Moses.
In Romans 7:14-24: Paul wanted to keep this Moral Law in Romans 13:8-10 but he could not do so because he was trying to keep all 613 laws of Moses (and he did not realize that Christ nailed to the cross those ordinances that were against us - Colossians 2:14).