God apparently made the rule that he had to die in order to forgive us for our sins. He presumably could have forgiven us for our sins anyway, in particular if he had been merely incarcerated.
Were I God, I would have been extremely angry with anyone involved in the lynching of an innocent person, especially My only-begotten Son. I would have given such people death with excruciating pain. Pancreatic cancer? Fluoride poisoning? White phosphorous? Dog attacks? (Dogs are not as efficient as bears or big cats as killers, but they are similarly effective.
Were I in the position of Pontius Pilate I would have told those who wanted Him killed that I would dispatch anyone dangerous to both Roman authority and the corrupt leadership of the Temple. He never instigated any riots or rebellion, so he was not guilty of anything.