This was to fulfill the word that Jesus had spoken to indicate the kind of death He was going to die.
ἵνα ὁ λόγος τοῦ Ἰησοῦ πληρωθῇ, ὃν εἶπε, σημαίνων ποίῳ θανάτῳ ἤμελλεν ἀποθνῄσκειν.