It's ideal for most judges to be elected to life terms. That limits concerns about them needing to serve the politics of the minute to get re-elected. They can take principled stands without worrying about being thrown out. The Supreme Court has routine stood up to both Congress and the President, and they can only do that because they can't be removed (except under extraordinary circumstances of corruption).
It is ideal for some judges to be elected to life terms, but not most. This is because community standards change, and most judges don't have the scrutiny the Supreme Court is under.