Legalism misinterprets the righteousness of God as justice, that is, as that principle of God's being that requires and demands the reward of good work (conformity to the Law) because of their intrinsic merit (remunerative justice) and the punishment of every transgression of the law with a proportionate punishment because of its own intrinsic demerit (retributive justice). According to this view, for God to do otherwise He would be unrighteous and unjust. Absolute justice, which according to this point of view is the eternal being of God, is said to require and demand, of necessity, the reward of meritorious good works and the punishment of sin. It was this legalistic concept of justice that gave Martin Luther so much trouble.
From this legalistic point of view, man needs to be saved because he is guilty of breaking the law. Salvation is accordingly conceived of as a removal of that guilt. Justice requires that the penalty be paid before the guilt can be removed. It cannot be forgiven freely but only can be taken away by the paying of the penalty which alone can satisfy justice. Because of the enormity of the guilt -- it is against an infinite moral being -- finite man himself can never pay the penalty and go free. From this legalistic point of view, man's sin demands an eternal punishment, and being finite he cannot meet the infinite demand of justice. If he is to be saved at all, he must be saved by another -- one who is man like himself but without sin, but also one who is God who alone can meet the infinite demand of justice. Where is such a one to be found? Only God can provide the one, and God has provided the perfect sacrifice to pay the penalty by sending His Son to become man. His death is the perfect sacrifice. It can remove the guilt by paying the penalty. In His death he endured the eternal punishment due to man's sin.
But from this legalistic point of view, it is not enough just to be declared not guilty; man must also have a righteousness which merits eternal life. He must not only have no guilt, no demerits, but he must also have a positive righteousness, merits placed to his account. Since man cannot earn this righteousness (merits) himself because of his sinful nature (he is not able not to sin and not able to do righteousness -- good works which merit eternal life as a reward), someone must earn this for him. According to this legalistic theology, salvation is not only a vicarious satisfaction of the demands of justice and the law, but it is also vicarious law-keeping. Christ's life of active obedience under the law provides the righteousness (merits) we need; Christ earned for us eternal life by His active obedience to the law. And by His passive obedience of death on the cross He paid for us (vicariously) the penalty of our sins. Therefore, the one who receives in faith Christ's work for him is declared not guilty, and Christ's righteousness (the merits of Christ) is imputed to his account. He is justified because Christ has satisfied the demands of justice and the law against him. He is legally entitled to eternal life if he receives it from Christ who earned it for him. Thus salvation is understood legalistically. It is a legal transaction -- a fire insurance policy that another paid for and gives freely to man if he will take it.
This is a consistent and logical explanation of salvation by Christ. There is only one difficulty with it -- it is not true. Yes, Christ died for man to take away his sin. The fact of Christ -- who He is and what He did -- is true, but the explanation is wrong -- it is legalistic. Salvation is not by meritorious works, even though another -- even God -- performs them. God is not the kind of God that the legalist thinks He is. He is not a God of law and justice but a God of love. Yes, God is just, that is, fair, but not in a legalistic sense. God is fair because he loves all men alike and therefore treats them impartially, without regard to their merit (Matt. 5:45). The problem solved by Christ's death was not in God but in man. God did not have to be reconciled and His justice satisfied before man could be saved. On the contrary, it is man who needs to be reconciled to God; it is man who needs to be changed. Man is dead and he needs to be made alive. The problem is in man -- he is dead and he needs life. Man does not need a lawyer; he needs one to raise him from dead. Only God can do that, and He has done it through His Son's death and resurrection. God was in Christ reconciling the world unto Himself (II Cor. 5:18, 19; see also Rom. 5:10-11) -- not reconciling God to the world. And since man sins because he is dead, by making him alive God saves him from sin to righteousness. He saves him not just from the guilt of sin but from sin itself. And He saves him not just from breaking the law but from trusting in false gods. God saves man to trust in God Himself -- the only real righteousness. Legal righteousness (merits) is not enough. For the real law wants faith, trust in and love of God -- "Thou shalt love the Lord thy God with all thy heart, soul and mind." And since death is what hinders this, God removed this hindrance and barrier by the death and resurrection of His Son. He entered into our death so that we could enter into His life -- through His resurrection. Being alive with Him we can now trust, love, and worship Him. So then as sin flows out of death, righteousness flows out of life -- out of Jesus Christ who is the life. Life is not some thing; it is a person -- Jesus Christ -- and to know Him and God through Him is to be alive (John 17:3). And to know Him and His love is to trust Him.