Elections are popularity contests, plain and simple. Voters elect who they like, who they think will do a good job, or sometimes, the person with the best hair or name recognition. The electoral process doesn't keep judges with questionable ethics off of the bench any more than it keep politicians with questionable ethics out of Congress or the White House.
That's not to say that the electoral process never works to keep unethical judges off the bench. When such practices are revealed in campaigns or high profile stories in the press, voters do sometimes decide to vote for someone else. Again, that's assuming the voters are informed and that they have an understanding of the law and ethics or conflicts of interest. I think that's not often the case.