Since it was the preparation day, the Jews did not want the bodies to remain on the cross on the Sabbath (for that Sabbath was a special day). They requested that Pilate have the men's legs broken and that [their bodies] be taken away.
References for John 19:31
So the soldiers came and broke the legs of the first man and of the other one who had been crucified with Him.
When they came to Jesus, they did not break His legs since they saw that He was already dead.
But one of the soldiers pierced His side with a spear, and at once blood and water came out.
He who saw this has testified so that you also may believe. His testimony is true, and he knows he is telling the truth.
References for John 19:35
For these things happened so that the Scripture would be fulfilled: Not one of His bones will be broken.
References for John 19:36
Also, another Scripture says: They will look at the One they pierced.
References for John 19:37