If we confess our sins, he is faithful and righteous to forgive us the sins, and to cleanse us from all unrighteousness.
The one answer to that is, Justice has been satisfied through the substitution of our blessed Lord and Saviour, Jesus Christ. When man sinned the law demanded that man must be punished. The first offense of man was committed by Adam, who was the representative of the entire race. When God would punish sin, in his own infinite mind he thought of the blessed expedient, not of punishing his people, but of punishing their representative, the covenant head, the second Adam. It was by one man, the first man, that sin entered into the world, and death by sin. It was by another man, the second Adam, who is the Lord from heaven, it was by him that this sin was borne; by him its punishment was endured; by him the whole wrath of heaven was suffered. And through that second representative of manhood, Jesus, the second Adam, God is now able and willing to forgive the vilest of the vile, and justify even the ungodly, and he is able to do so without the slightest violation of his justice. For, mark, when Jesus Christ the Son of God suffered on the tree, he did not suffer for himself. He had no sin, either natural or actual. He had done nothing whatever that could bring him under the ban of heaven, or subject his holy soul and his perfect body to grief and pain. When he suffered it was as a substitute. He died "the just for the unjust, that he might bring us to God." Had his sorrows been personally deserved they would have had no efficacy in them. But inasmuch as for sins not his own he died to atone; inasmuch as he was punished, not for any guilt that he had done or could do, but for the guilt incurred by others, there was a merit and an efficacy in all that he suffered, by which the law was satisfied, and God is able to forgive.
