Using a new dataset capturing the ideological positioning of nearly half a million U.S. judges and lawyers, we present evidence showing how ideology affects the selection of judges across federal and state judiciaries. We document that the higher the court, the more it deviates ideologically from the ideology of attorneys, suggesting ideology plays a strong role in judicial selection. We also show ideology plays stronger roles in jurisdictions where judges are selected via political appointments or partisan elections. Our findings suggest that ideology is an important component of judicial selection primarily where (1) using ideology leads to expected benefits to politicians, (2) when the jurisdiction's selection process allows ideology to be used, and (3) where it concerns the most important courts. The study is the first to provide a direct ideological comparison across judicial tiers and between judges and lawyers and to explain how and why American courts become politicized.