A federal judge in Seattle issued a ruling that temporarily blocks President Donald Trump’s executive order on immigration and refugees, a decision that applies nationwide to tens of thousands of people holding visas to travel to the U.S.

While previous court orders addressed the plight of detained travelers, U.S. District Judge James Robart’s more-sweeping ruling stops the executive order entirely.

A...