Forgiveness is when someone gives up their right to get even with you, but that doesn't stop the natural and judicial consequences that still come with sin. Sin carries a cost, especially against a holy and infinite God, so someone absolutely has to pay for it if God is to be considered just.
But in His love for us, God put the punishment on Jesus, instead of us. Jesus paid the penalty for what we deserved.