He did not say this on his own, but as high priest that year he prophesied that Jesus would die for the Jewish nation,
It was thought that the High Priest was God’s spokesman and he would prophesy on His behalf (Num 27:18-21). In actuality, what Caiaphas meant as “a piece of cynical, political realism” (Morris) was used by God to speak of a much more wonderful and profound truth. Note that it is possible to prophesy and not know the significance of what you said. Do you think Caiaphas would fit in the category described by Jesus in (Matt 7:21-23)? God can use bad men to prophesy (Num 23:5) and He can use men to do it without knowing they are doing so(John 19:19-22). Note that if God can use an evil, self-centered man like Caiaphas, He can use you!
Numbers 27:18-21 So the LORD said to Moses, “Take Joshua son of Nun, a man in whom is the spirit, and lay your hand on him. Make him stand before Eleazar the priest and the entire assembly and commission him in their presence. Give him some of your authority so that the whole Israelite community will obey him. He is to stand before Eleazar the priest, who will obtain decisions for him by enquiring of the Urim before the LORD. At his command he and the entire community of the Israelites will go out, and at his command they will come in.”
Matthew 7:21-23 “Not everyone who says to me, ‘Lord, Lord,’ will enter the kingdom of heaven, but only he who does the will of my Father who is in heaven. Many will say to me on that day, ‘Lord, Lord, did we not prophesy in your name, and in your name drive out demons and perform many miracles?’ Then I will tell them plainly, ‘I never knew you. Away from me, you evildoers!’
Numbers 23:5 The LORD put a message in Balaam’s mouth and said, “Go back to Balak and give him this message.”
John 19:19-22 Pilate had a notice prepared and fastened to the cross. It read: JESUS OF NAZARETH, THE KING OF THE JEWS. Many of the Jews read this sign, for the place where Jesus was crucified was near the city, and the sign was written in Aramaic, Latin and Greek. The chief priests of the Jews protested to Pilate, “Do not write ‘The King of the Jews’, but that this man claimed to be king of the Jews.” Pilate answered, “What I have written, I have written.”
Caiaphas prophesied that Jesus would die a substitutionary death; not one for himself, but for others. This was fulfilled (Gal 3:13, 2 Cor 5:14, Rom 5:6).
Galatians 3:13 Christ redeemed us from the curse of the law by becoming a curse for us, for it is written: “Cursed is everyone who is hung on a tree.”
2 Corinthians 5:14 For Christ’s love compels us, because we are convinced that one died for all, and therefore all died.
Romans 5:6 You see, at just the right time, when we were still powerless, Christ died for the ungodly.