President Donald Trump’s appointment of hundreds of federal judges helps him appeal to social conservatives and ensures a long-lasting legacy.