You seem to be forgetting that the Romans were in charge. Either that or you don’t know anything about politics. The Romans had the power and therefore they had many suckups among the Jews for various reasons. Easy to organize things the way you want them to go under those circumstances.
No I am not forgetting who was in charge. Remember Pilot offered them a choice as to who would be pardoned, he washed his hands of the whole thing and gave them what they wanted. Barabas