I don't think people literally voted for the judge to lock up a single mother of 3 girls for 500 days because of unpaid traffic tickets.
They voted for a judge because they thought he would be "tough on crime", or some other slogan. I am really speculating here. The reason though is a lack of information on the voters part. I am not sure how we solve that problem though.
Judges like this should be put disbarred so that they cant practice law or serve time themselves.