To answer a question like that we should put our hands on our mouths and silence our philosophical speculations. Our opinions don't count here. All that counts is what God himself has shown us in his word. And the first thing he shows us is that the details surrounding the death of Jesus were prophesied in God's word hundreds of years before they happened.

The Scriptures show that evil men would reject Jesus when he came. Matthew 21:42: "Jesus said to them [quoting Psalm 118:22], ‘Have you never read in the Scriptures: "The stone that the builders rejected has become the cornerstone; this was the Lord's doing, and it is marvelous in our eyes"?'"

The Scriptures showed that Jesus must be hated. In John 15:25, Jesus quoted Psalm 35:19 and said, "The word that is written in their Law must be fulfilled: ‘They hated me without a cause.'"

The Scriptures showed that the disciples would abandon Jesus. In Matthew 26:31, Jesus quotes Zechariah 13:7: "You will all fall away because of me this night. For it is written, ‘I will strike the shepherd, and the sheep of the flock will be scattered.'"

The Scriptures showed that Jesus would be pierced, but none of his bones would be broken. John quotes Psalm 34:20 and Zechariah 12:10 and says, "One of the soldiers pierced his side with a spear. . . . For these things took place that the Scripture might be fulfilled: ‘Not one of his bones will be broken.' And again another Scripture says, ‘They will look on him whom they have pierced'" (John 19:34-37).

The Scriptures showed that Jesus would be betrayed by a close friend for thirty pieces of silver. In John 13:18, Jesus cites Psalm 41:9 and says, "I am not speaking of all of you; I know whom I have chosen. But the Scripture will be fulfilled, ‘He who ate my bread has lifted his heel against me.'" In Matthew 26:24, Jesus says, "The Son of Man goes as it is written of him, but woe to that man by whom the Son of Man is betrayed!" And Matthew 27:9-10 says, "Then was fulfilled what had been spoken by the prophet Jeremiah, saying, ‘And they took the thirty pieces of silver, the price of him on whom a price had been set by some of the sons of Israel, and they gave them for the potter's field, as the Lord directed me'" (Jer. 19:1-13; Zech. 11:12-13).

em>

And not only the Scriptures, but Jesus himself declared, down to the details, how he would be killed. In Mark 10:33-34 he says, "See, we are going up to Jerusalem, and the Son of Man will be delivered over to the chief priests and the scribes, and they will condemn him to death and deliver him over to the Gentiles. And they will mock him and spit on him, and flog him and kill him. And after three days he will rise." And on that last night, Jesus looked at Peter and said, "Truly, I tell you, this very night, before the rooster crows, you will deny me three times" (Matt. 26:34). 

According to His Sovereign Will
From all these prophesies, we know that God foresaw and did not prevent and therefore included in his plan that his Son would be rejected, hated, abandoned, betrayed, denied, condemned, spit upon, flogged, mocked, pierced, and killed. All these are explicitly in God's mind before they actually happen as things that he plans will happen to Jesus. These things did not just happen. They were foretold in God's word. God knew they would happen and could have planned to stop them, but didn't. So they happened according to his sovereign will. His plan.

And all of them were evil. They were sin. It is surpassingly sinful to reject, hate, abandon, betray, deny, condemn, spit upon, flog, mock, pierce, and kill the morally perfect, infinitely worthy, divine Son of God. And yet the Bible is explicit and clear that God himself planned these things. This is explicit not only in all the prophetic texts we have seen, but also in passages that say even more plainly that God ordained that these things come to pass.