This doesn’t mean they’re legal, it means the courts won’t stop those individuals from being deported while the legal case for the policy is being argued. The decision to grant, or not, an injunction is not in itself a judgement on the underlying policy. The court did the former, not the latter.