A federal appeals court on Thursday unanimously ruled against President Donald Trump’s executive order on immigration and refugees, saying such a travel ban shouldn’t go into effect while courts consider whether it goes too far in limiting travelers to the U.S.

The appeals court declined to take a position on the most pointed accusation leveled at the Trump administration—that the Jan. 27 executive order restricting immigration from seven predominantly Muslim countries discriminated on the basis of religion. Instead, the panel...