Legislatures make laws, judges conduct trials and hand out sentences based upon law. The system for which you advocate sounds much more like Sharia than the one we have...and I support. Only under Sharia is a judge prosecutor, judge, jury, and executioner. We separate the functions.
If you don't like the law, change it...
Its amazing how the law is being ignored here when constantly I see threads complaining about judges legislating from the bench.
I guess it depends on the case?
I don't think the judge was out of line at all.