Jesus probably never even existed. There's no historical proof whatsoever. However, if he did exist, he was very likely prosecuted for something else. In the muslim version(or some arabian or other middle eastern version) Jesus was executed because he committed a major crime, something on par with rape -but that variation on the Jesus story came up later, and was mere folklore as well.
I never understood why a person would have to die for no reason(Jesus), just so a less virtuous person(A sinner) could go free. Doesn't make any sense to me at all, whatever way I look at it.