A God who is capable of creating the universe - the stars, planets, earth, and life itself must be perfect.
Perfect, Righteous, and Holy.
And only a creature who is perfect, righteous, and holy itself is capable of sharing eternity with such a God.
It is necessary. God requires such. Perfection requires perfect. Righteousness requires righteous. Holiness requires holy.
Man by himself is none of these things.
So out of love for His creation - man, God the Son said to God the Father,
"I will go down to earth as a man - the Son of man.
I will live a perfect, righteous, and holy life.
I will be all of these things.
I will be without sin - anything that is not righteous.
I will justify man as perfect, righteous, and holy so that he may spend eternity with You.
And then to atone for the sin of all men I will lay down my life as a man to redeem all of mankind."
And then God the Father said to God the Son,
"I will accept this - for any man who believes in this and as long as he comes to Me thru You"