Why do federal judges serve for life?

So that they won't be subject to elections and could possibly be partial to part of their constituency.