WASHINGTON — The Supreme Court upheld President Trump’s ban on travel from several predominantly Muslim countries, delivering to the president on Tuesday a political victory and an endorsement of his power to control immigration at a time of political upheaval about the treatment of migrants at the Mexican border.