Legality of the Supreme Court upholding Pres. Trump’s travel ban

What does the decision to uphold Pres. Trump’s travel ban mean legally? What is likely to happen with the immigrants banned from these countries?