A federal judge in Hawaii issued a nationwide temporary restraining order Wednesday that bars implementation of President Donald Trump’s revised executive order on immigration and refugees, a significant legal blow to the president’s renewed bid to restrict U.S. entry for people from six Muslim-majority countries.

Mr. Trump made several changes to his travel restrictions after courts last month faulted his original executive order, but U.S. District Judge Derrick Watson said none of the alterations fixed a central problem:...