"But our God is in the heavens: he hath done whatsoever he hath pleased." (Psalm 115:3)
We often raise questions about God's actions, but He is never obligated to explain to us His reasons. It is enough to know that it pleased Him, for whatever He does is right by definition.
For example, if someone asks why God created the universe, we must answer simply that it was for His "pleasure they are and were created" (Revelation 4:11). "Whatsoever the LORD pleased, that did he in heaven, and in earth, in the seas, and all deep places" (Psalm 135:6). He does not have to give account to us, for we also were created at His pleasure.
And why did He allow His Son to suffer and die on the cross? Although "he had done no violence, neither was any deceit in his mouth. Yet it pleased the LORD to bruise him" and to "make his soul an offering for sin," knowing that eventually "the pleasure of the LORD shall prosper in his hand" (Isaiah 53:9-10).
We may never be able to understand why God has done this, especially for sinners such as us, but we don't have to understand. "It pleased God . . . to save them that believe" (1 Corinthians 1:21), not them that understand.
We can be sure that God does have perfect reasons for everything He does, and perhaps we shall understand it all in eternity. In the meantime, we are simply (with Paul) to be thankful that "it pleased God, who . . . called me by his grace, To reveal his Son in me" (Galatians 1:15-16). He has, in some way beyond comprehension, "predestinated us unto the adoption of children by Jesus Christ to himself, according to the good pleasure of his will" (Ephesians 1:5), and that is enough to know for now. HMM