To be just God must punish sinners for committing sins. Jesus took upon Himself the sins of the world so that sinners could be forgiven by God without violating justice. Even if the Lord wants to shew mercy He must not violate justice to do so. Jesus shed His blood for the sins of the world
1 John 2:2
And he is the
propitiation for our sins: and not for ours only, but also for the sins of the whole world.
and took away the sin of the world
John 1:29
The next day John seeth Jesus coming unto him, and saith, Behold
the Lamb
of God, which taketh away
the sin of the world.
so that the world might be saved
John 3:17
For God sent not his Son into the world to condemn the world; but that the world through him
might be saved.