The Torah commands that a blasphemer be stoned to death, and then that his corpse be hung on a tree until late afternoon, for “God’s curse is on the one who hangs upon a tree.” The body was then buried before nightfall. In the case of Jesus, since the Sanhedrin lacked legal authority to put Jesus to death, they chose to turn Him over to the Romans to have Him hung on a tree until dead. It wasn’t ideal, but it was the most consistent thing they could do to Whom they judged a blasphemer.
Granted, the trial of Jesus makes a mockery of Jewish jurisprudence: convening at night, on the eve of a Sabbath and Festival no less, not dismissing charges when witnesses failed to agree, not allowing any witnesses for the defense (Malchus should have been called to testify how Jesus healed his ear, for one), convening in the absence of certain members of the Sanhedrin who would be sympathetic to Jesus, convicting a man based on His own testimony (which was not even corroborated), and no effort made to demonstrate that Jesus’ claim of being the Messiah actually constituted blasphemy. Yet, these hypocrites still felt the need to keep up public appearances, so they dared not enter the praetorium, lest they be ritually defiled and excluded from eating the Passover. For this reason, they sought to have Jesus crucified, so as to maintain the appearance of keeping the Law.