Judges, in principle, cannot *change* the law. *Juries* are the ones who can determine whether or not a law applies or that a person ought to be punished, and all that takes place at a trial.
The power is supposed to be in the *jury*, not the *judge*. The judge is like an administrator, to be sure there is due process and that the law is followed before and at trial.
And *legislatures* are responsible for *changing* bad laws once they are discovered to be so.