Judges are appointed for a number of good reasons. But this is a good question. The appointment process and tenure are some of the conditions used to give judges enough security to effectively do their job. The idea is that the judicial branch be at arms-length from political counterparts.
Things constantly change; I think of civil rights legislation in this case. When the mood of the times changes, its up to judges and judicial review to keep laws up-to-date. This way, we are able to have a set of laws, but laws which are subject to changes at the discretion of judges.
Electing judges, on the whole, is a good idea, but the problem comes when judges are faced with re-election. While not all judges are given lifetime appointments - most of them have quite a considerable amount of 'protection' over their decisions. To make up for the fact that judges are prone to human errors, we have the appeals process. A distinctive judicial hierarchy also accounts for this. (lower courts, regional courts, state/provincial courts, supreme court)
Another thing to think about is that judges tend to deal with matters that may take more time than the conventional election cycle. I think it serves judicial economy well to have judges appointed and a safe distance from political interference because it allows them to do their job in an unbiased fashion. Elected judges could turn the judicial system into a popularity contest; we're looking for qualified judges not popular candidates. I tend to feel that people are ill-informed enough about general politicians, let alone judges' qualifications. Kind of like electing doctors; I wouldn't really know whether im making a wise vote or not, in the end, the electorate really isn't qualified to make those kinds of decisions.
The problem with appointments is potential corruption, but for the sake of arguing, I'd rather have an appointed judiciary with a few bad apples than I would a revolving door judiciary prone to making partisan decisions.