The doctrine of imputation is critically important in understanding the work Jesus for us did on the cross. We are sinners. While we were yet sinners, Christ died for us. God has to punish sin. We deserve that punishment. God allowed Jesus to take that punishment for us as a substitute. The doctrine of imputation says that God now looks on us "as if" we had the perfection of Jesus imputed to our account, and God punished Jesus for our sins (all of them) by imputing our sins on Jesus. Jesus became our substitute on the cross. His imputed righteousness becomes our justification.
423 Now it was not written for his (Abraham's) sake alone that it was imputed to him, 24 but also for us. It shall be imputed to us who believe in Him who raised up Jesus our Lord from the dead, 25who was delivered up because of our offenses, and was raised because of our justification.
5:1 Therefore, having been justified by faith, we have peace with God through our Lord Jesus Christ, 2 through whom also we have access by faith into this grace in which we stand, and rejoice in hope of the glory of God.