The ruling came in a lawsuit brought by major refugee aid groups, who argued that Trump's executive order ran afoul of the system Congress created.