The difference of the nature of the work, carnal and spiritual, is the mystery of why Romans rejects being justified by works, and James declares being justified by works.
Obedience to the works of the law are not necessarily of faith nor spiritual in nature. Any sinner on earth can do the law of Christ by neighborliness and not being adulterers, drunkards, thieves, etc... Like Pharisees, any person can do the outward works of the law, if they will to do so without double mindedness.
But as many as received him, to them gave he power to become the sons of God, even to them that believe on his name: Which were born, not of blood, nor of the will of the flesh, nor of the will of man, but of God.
Works of faith however are necessary to be justified by Christ, because they are works of the Spirit, which fulfill the righteousness of the law by inward purity first. These first works of the Spirit within us manifest themselves, not just in obedience to the law outwardly, but in offering up our souls and lives unto Christ on our own cross, even as He did unto the Father on His cross, and as Abraham did to the God of Israel on the altar of Isaac.
How much more shall the blood of Christ, who through the eternal Spirit offered himself without spot to God, purge your conscience from dead works to serve the living God?
It is only by the eternal Spirit, that we can also offer up ourselves to God, not just to do the works of His law, but to do whatsoever he says to us in faith to do:
Ye are my friends, if ye do whatsoever I command you. Henceforth I call you not servants; for the servant knoweth not what his lord doeth: but I have called you friends; for all things that I have heard of my Father I have made known unto you.
Works of faith are justifying works of the Spirit through faith:
By faith Abraham, when he was tried, offered up Isaac: and he that had received the promises offered up his only begotten son, Of whom it was said, That in Isaac shall thy seed be called:
Accounting that God was able to raise him up, even from the dead; from whence also he received him in a figure.
Abraham offered up his own son of promise, by believing God would raise Isaac from the dead by His Spirit, if necessary, to fulfill His promise to Abraham.
Only when faith is tried to offer up our own selves through faith in the eternal Spirit, are we justified as our Father Abraham.
By works of the law we cannot be justified, which requires no faith nor Spirit dwelling within, but by works of faith we justified by Christ, because such works need the eternal Spirit in which to do them.