There are certainly pros and cons electing judges by popular ballot. In fact, thirty-nine of the fifty US states hold elections for judges. Let's look at some of the common arguments on both sides of this issue.
Electing judges makes them accountable to the public. If the people feel that a judge is doing a poor job or is abusing their power, the people have an opportunity to vote in someone else.
Appointed judges may feel beholden to the executive and legislature that put them on the bench. Elected judges, on the other hand, can be more independent from the other branches of government.
Many judges run unopposed. This eliminates the aspect of public accountability that elections were designed to provide.
Elected judges often feel pressure to make their decisions in accordance with popular opinion. Often, the right or legally fair decision is neither popular nor easy. It has become common for judges to make overly harsh rulings in order to appear tough on crime. Studies have shown that judges tend to be particularly harder on crime during election years.
It is expensive for judges to run for election. To raise money, many judicial candidates will seek donations from lawyers, businesses, special interest groups, and even potential defendants. This presents a clear conflict of interest should any of these parties appear before that judge in a trial.