Federal judges serve for life because it guarantees the separation of powers. If these judges didn't serve for life they could leave any time, which would lead to different decisions. The government appoints the federal judges to these terms
Hope I helped ya!!! xD