Jesus both obeyed the law and paid the penalty for sin in the place of his people, as their substitute. This is a summary of the gospel, of the satisfaction (or atonement) that Christ has made for us as Priest and Sacrifice. Louis Berkhof says it well in his discussion of the nature of the atonement – specifically concerning the active obedience of Christ:
“If Christ had merely obeyed the law and had not also paid the penalty, he would not have won a title to eternal life for sinners; and if he had merely paid the penalty, without meeting the original demands of the law, he would have left man in the position of Adam before the fall, still confronted with the task of obtaining eternal life in the way of obedience. By his active obedience, however, he carried his people beyond that point and gave them a claim to everlasting life” (Berkhof, Systematic Theology, 2.381).
There is therefore now no condemnation for those who are in Christ (Rom. 8.1)!