Supreme court order gives administration the green light to turn away those who have passed through a third country