God can forgive sins justly because Christ took upon Himself the sins of His people and satisfied the justice of God (Romans 3:26).
In Romans 3:26, it is explained that God is both just and the justifier of those who have faith in Jesus. This means that God's forgiveness is rooted in Christ's atoning sacrifice, where He bore the penalty for our sins on the cross. God's justice required that sin be paid for, and through Christ, that payment was made. When we confess our sins, we are not merely asking for forgiveness; we are acknowledging the justice of God's judgment against sin. Because of Christ's work, God can forgive us without compromising His righteousness, affirming that He remains just while offering grace to sinners who believe in His Son.
Commentary