Because God is a holy God, His anger and justice burns against sin. And He has sworn that sin will be punished.
There must be a satisfactory payment for sin. But God said, "If I punish man for his sin, man will die and go to hell. On the other hand, if I don't punish man for his sin, My justice will never be satisfied."
The solution? God said that He would become our substitute. He would take the sin of mankind upon Himself in agony and blood—a righteous judgment and substitute for sin.
His wrath burned out on the cross when His only Son died as man's propitiation for sin. And this is love.
(1 John 4:10).
In this is love, not that we loved God, but that He loved us and sent His Son to be the propitiation concerning our sins.
1Jn 4:11 Beloved, if God so loved us, we ought also to love one another.
Joh 3:16 For God so loved the world that He gave His only-begotten Son, that whoever believes in Him should not perish but have everlasting life.
Joh 3:17 For God did not send His Son into the world to condemn the world, but so that the world might be saved through Him.
Joh 3:18 He who believes on Him is not condemned, but he who does not believe is condemned already, because he has not believed in the name of the only-begotten Son of God.