So, my brothers and sisters, you also died to the law/righteousness of obeying it through the body of Christ, that you might belong to another, to him who was raised from the dead, in order that we might bear fruit for God. 5 For when we were in the realm of the flesh,the sinful passions aroused by the law were at work in us, so that we bore fruit for death. 6 But now, by dying to what once bound us, we have been released from the law so that we serve in the new way of the Spirit, and not in the old way of the written code. Rom7:46
Which law is Paul writing about in the above, does it include the decalogue? In the next five verses he tells us, he gives an example of why he had to die to the law as he put it:
What shall we say then? Is the law sin? God forbid. Nay, I had not known sin, but by the law: for I had not known lust, except the law had said, Thou shalt not covet.
8 But sin, taking occasion by the commandment, wrought in me all manner of concupiscence. For without the law sin was dead. 7-11
9 For I was alive without the law once: but when the commandment came, sin revived, and I died.
10 And the commandment, which was ordained to life, I found to be unto death.
11 For sin, taking occasion by the commandment, deceived me, and by it slew me. 7-11
The example Paul gave as to why he had to die to the law/righteousness of obeying it was: Thou shalt not covet, one of the ten commandments
Here Paul accomodates himself to the merely natural minds of those folks of those times, basically, arguing from their points in some places, and clarifying the matters in the more genuine light in others. So, in some places, he presents himself standing on the position of the external mind with its lusts and appearances, and in other places, he speaks in the more elevated way, from the position of the more interior man.
So, in some places he attributes all the problems to the law, as if the latter being the cause of all the problems, for this is how it appears to a person with a merely natural mind, besides, that it is God who persecutes him, hates him, destroys him, etc. While in other places Paul clarifies that the law is good, and that he delights in its with his internal man. While his external man hates it.
I added the emphasis so that it may become more clear what is what.
14 We know that the law is spiritual; but I am unspiritual, sold as a slave to sin. 15 I do not understand what I do. For what I want to do I do not do, but what I hate I do. 16 And if I do what I do not want to do, I agree that the law is good. 17 As it is, it is no longer I myself who do it, but it is sin living in me. 18 For I know that good itself does not dwell in me, that is, in my sinful nature.[c] For I have the desire to do what is good, but I cannot carry it out. 19 For I do not do the good I want to do, but the evil I do not want to do—this I keep on doing. 20 Now if I do what I do not want to do, it is no longer I who do it, but it is sin living in me that does it.
21 So I find this law at work: Although I want to do good, evil is right there with me. 22 For in my inner being I delight in God’s law; 23 but I see another law at work in me, waging war against the law of my mind and making me a prisoner of the law of sin at work within me. 24 What a wretched man I am! Who will rescue me from this body that is subject to death? 25 Thanks be to God, who delivers me through Jesus Christ our Lord! So then, I myself in my mind am a slave to God’s law, but in my sinful nature[d] a slave to the law of sin.
So, basically, Paul is saying that he knows that the law, that is, the law in its essence, which is the spiritual-moral commandments, leading to life eternal (according to the citations from Gospel), is good, but that he, Paul, enjoys that law in his internal mind, thus, in intentions, commitments, determinations, but when it comes to follow it in real life, thus, in shunning adultery, hatred, revenge, dishonesty, hypocrisy, then he finds that in his external man there are tendencies loving those evils, and hating the will of God, thus hating the commandments, and basically willing to remain in the faith of demons, of which James speaks.
So, he is disposed to be a slave to God's law, in his internal man, but in his external he wants to commit all kind of evils.
The way to regeneration then is to bring the external man in correspondence with the internal, thus to live according to the dispositions, intentions, commitments, determinations, not in such a way that a Christian would be talking about loving justice, righteousness, equitability, chastity, but in fact acting like demons, and even parading that, being proud in not avoiding those evils, thus living worse that the unistructed heathen.
"302. In the spiritual sense, this commandment signifies man's reformation and regeneration by the Lord, "the six days of labor" signifying his warfare against the flesh and its lusts, and at the same time against the evils and falsities that are in him from hell, and "the seventh day" signifying his conjunction with the Lord, and regeneration thereby. That man's spiritual labor continues as long as that warfare lasts, but when he is regenerated he has rest, will be shown in what is to be said hereafter in the chapter on Reformation and Regeneration, especially under the following sections there:
(1) Regeneration is effected in a manner analogous to that in which man is conceived, carried in a womb, born, and educated
(2) The first act in the new birth is called reformation, which belongs to the understanding; and the second is called regeneration, which belongs to the will and therefrom to the understanding.
(3) The internal man is to be reformed first, and through that the external.
(4) Then a conflict arises between the internal and the external man, and the one that conquers rules the other.
(5) The regenerate man has a new will, and a new understanding; and so forth.
The reformation and regeneration of man are signified by this commandment in the spiritual sense, because they coincide with the labors and combats of the Lord with the hells, and with His victory over them, and the rest that followed. For the Lord reforms and regenerates man and renders him spiritual in the same manner in which He glorified His Human and made it Divine; and this is the meaning of the command to "follow Him." That the Lord had combats, which are called "labors," is evident from Isa. 53 and 58; and that like things are called "labors" in reference to men, from Isa. 65:23; Apoc. 51:2, 3."
"596. VII. WHEN THIS TAKES PLACE A CONFLICT ARISES BETWEEN THE INTERNAL AND THE EXTERNAL MAN, AND THEN THE ONE THAT CONQUERS RULES OVER THE OTHER.
A conflict then arises because the internal man is reformed by means of truths; and from truths he sees what is evil and false, which evil and falsity are still in the external or natural man; consequently disagreement first springs up between the new will, which is above, and the old will, which is below; and as the disagreement is between the two wills, it is also between their delights; for the flesh, it is well known, is opposed to the spirit and the spirit to the flesh, and the flesh with its lusts must be subdued before the spirit can act and man become new. After this disagreement of the two wills a conflict arises; and this is called spiritual temptation. This temptation or conflict does not take place between goods and evils, but between the truths of good and the falsities of evil. For good cannot fight from itself but fights by means of truths; nor can evil fight from itself but by means of its falsities; just as the will cannot fight from itself but by means of the understanding where its truths reside.
[2] Man is not sensible of that conflict except as in himself, and as remorse of conscience; and yet it is the Lord and the devil (that is, hell) that are fighting in man, and they are fighting for dominion over him, or to determine who shall possess him. The devil or hell attacks man and calls out his evils, while the Lord protects him and calls out his goods. Although that conflict takes place in the spiritual world, still it takes place in man between the truths of good and the falsities of evil that are in him; therefore man must fight wholly as if of himself, for he has the freedom of choice to act for the Lord, and also to act for the devil; he is for the Lord, if he abides in truths from good, and for the devil, if he abides in falsities from evil. From this it follows that whichever conquers, the internal man or the external, that one rules over the other; precisely like two hostile powers contending as to which shall be master of the other's kingdom-the conqueror takes possession of the kingdom, and places all in it under obedience to himself. In this case, therefore, if the internal man conquers, he obtains dominion and subjugates all the evils of the external man, and regeneration then goes on; but if the external man conquers, he obtains the dominion, and dissipates all the goods of the internal man, and regeneration perishes."