To teach us this ...
Well then, am I suggesting that the law of God is sinful? Of course not! In fact, it was the law that showed me my sin. I would never have known that coveting is wrong if the law had not said, "You must not covet." But sin used this command to arouse all kinds of covetous desires within me! If there were no law, sin would not have that power. At one time I lived without understanding the law. But when I learned the command not to covet, for instance, the power of sin came to life, and I died. So I discovered that the law's commands, which were supposed to bring life, brought spiritual death instead. Sin took advantage of those commands and deceived me; it used the commands to kill me. But still, the law itself is holy, and its commands are holy and right and good.
But how can that be? Did the law, which is good, cause my death? Of course not! Sin used what was good to bring about my condemnation to death. So we can see how terrible sin really is. It uses God's good commands for its own evil purposes.
So the trouble is not with the law, for it is spiritual and good. The trouble is with me, for I am all too human, a slave to sin. I don't really understand myself, for I want to do what is right, but I don't do it. Instead, I do what I hate. But if I know that what I am doing is wrong, this shows that I agree that the law is good. So I am not the one doing wrong; it is sin living in me that does it.
And I know that nothing good lives in me, that is, in my sinful nature. I want to do what is right, but I can't. I want to do what is good, but I don't. I don't want to do what is wrong, but I do it anyway. But if I do what I don't want to do, I am not really the one doing wrong; it is sin living in me that does it.
I have discovered this principle of life--that when I want to do what is right, I inevitably do what is wrong. I love God's law with all my heart. But there is another power within me that is at war with my mind. This power makes me a slave to the sin that is still within me. Oh, what a miserable person I am! Who will free me from this life that is dominated by sin and death? Thank God! The answer is in Jesus Christ our Lord. So you see how it is: In my mind I really want to obey God's law, but because of my sinful nature I am a slave to sin. [Romans 7:7-25 NLT]