Presidents (in general) will tend to appoint judges who align with their own views on political justice because they don't want their own attempts at leadership blocked by the courts, and also they hope to be able to leave a lasting legacy on nation overall through what they would consider favorable court decisions.
Ideally, however, presidents will choose appointees for federal courts and the Supreme Court based on the overall strength of their qualifications, not merely based on political leanings they may seem to have.