Background
Prior to Jesus being brought to Pilate, there were three criminals in custody awaiting execution. Since it was the custom to release one, the Romans would have been prepared to crucify the other two. It is speculation, but it is reasonable to believe the two upright pieces of those two crosses had been put in place the day before. Then, after one had been freed, the other two would carry the other piece of their cross to the place where they would be crucified.
Jesus' was a third and unexpected crucifixion, which the Roman soldiers would not have prepared; both pieces of the cross would have to be carried out. This fits the otherwise conflicting accounts of Jesus making the trip to Golgotha. Regardless of the exact details, Jesus' crucifixion was something the Roman soldiers had to deal with "at the last minute."
We know the Roman soldiers mocked Jesus and hailed Him as King, so it is reasonable to conclude they decided to place Him in the middle, which would have been the "position of honor."
Fulfilling Scripture
The Crucifixion and Resurrection are the focal point in God's plan of salvation and nothing was "by chance." On the day of Pentecost Peter says as much:
this Jesus, delivered up according to the definite plan and foreknowledge of God, you crucified and killed by the hands of lawless men. (Acts 2:23) [ESV]
For example, the method of execution could not be by stoning:
Christ redeemed us from the curse of the law by becoming a curse for us—for it is written, “Cursed is everyone who is hanged on a tree” (Galatians 3:13)
“And if a man has committed a crime punishable by death and he is put to death, and you hang him on a tree, his body shall not remain all night on the tree, but you shall bury him the same day, for a hanged man is cursed by God. You shall not defile your land that the LORD your God is giving you for an inheritance. (Deuteronomy 21:22-23)
The people acted in ignorance [of God's plan (Acts 3:17)], but the course of history was guided by God so that His plan would be fulfilled, according to Scripture. Isaiah 53 describes in detail the Suffering Servant. It ends with this passage:
Therefore I will divide him a portion with the many,
and he shall divide the spoil with the strong,
because he poured out his soul to death
and was numbered with the transgressors;
yet he bore the sin of many,
and makes intercession for the transgressors. (53:12)
He was numbered with the transgressors... "Numbered" is the Hebrew manah which Gesenius' Lexicon says properly means "to be divided, to be divided out, to divide." In this form it can also mean to be reckoned, to be assigned. So by being placed between two transgressors, Jesus "divided" them; actually being "assigned" His position. This was necessary to fulfill Isaiah 53:12.
Also note that Isaiah says He "makes intercession for the transgressors. This was actually fulfilled while on the cross in the singular with the one thief who repented and in the plural:
And Jesus said, “Father, forgive them, for they know not what they do.” (Luke 23:34)
So we might say the plan of salvation was not only fulfilled; it was literally being "acted" out in real-time for the other participants. Similarly, just as Jesus death was a substitution for all sinners, He actually took Barabbas' place.
Finally, the Gospel of John begins with a description of the Word which was with God coming to the world and returning to God. This too follows Isaiah:
8 For my thoughts are not your thoughts, neither are your ways my ways, declares the LORD. 9 For as the heavens are higher than the earth, so are my ways higher than your ways and my thoughts than your thoughts. 10 “For as the rain and the snow come down from heaven and do not return there but water the earth, making it bring forth and sprout, giving seed to the sower and bread to the eater, 11 so shall my word be that goes out from my mouth; it shall not return to me empty, but it shall accomplish that which I purpose, and shall succeed in the thing for which I sent it. (Isaiah 55)
The word ...shall not not return to me empty...." The Hebrew רֵיקָם is usually translated as empty-handed:
If the God of my father, the God of Abraham and the Fear of Isaac, had not been on my side, surely now you would have sent me away empty-handed. God saw my affliction and the labor of my hands and rebuked you last night.” (Genesis 31:42)
Again there is a literal fulfillment when one thief had a change of heart:
40 But the other rebuked him, saying, “Do you not fear God, since you are under the same sentence of condemnation? 41 And we indeed justly, for we are receiving the due reward of our deeds; but this man has done nothing wrong.” 42 And he said, “Jesus, remember me when you come into your kingdom.” 43 And he said to him, “Truly, I say to you, today you will be with me in paradise.” (Luke 23)
The Word did not return "empty-handed." He brought the penitent thief.
Conclusion
Being crucified between two other transgressors was necessary to fulfill the prophecy of the Suffering Servant. Likewise, the "death bed" request from one of the thieves was necessary, or at least was an immediate fulfillment of the work of the Word as described in Isaiah 55.