A word from Charles Hodge on imputation of righteousness:
It seems unnecessary to remark that this does not, and cannot mean that the righteousness of Christ is infused into the believer, or in any way so imparted to him as to change, or constitute his moral character. Imputation never changes the inward, subjective state of the person to whom the imputation is made. When sin is imputed to a man he is not made sinful; when the zeal of Phinehas was imputed to him, he was not made zealous. When you impute theft to a man, you do not make him a thief. When you impute goodness to a man, you do not make him good. So when righteousness is imputed to the believer, he does not thereby become subjectively righteous. If the righteousness be adequate, and if the imputation be made on adequate grounds and by competent authority, the person to whom the imputation is made has the right to be treated as righteous. And, therefore, in the forensic, although not in the moral or subjective sense, the imputation of the righteousness of Christ does make the sinner righteous. That is, it gives him a right to the full pardon of all his sins and a claim in justice to eternal life.