Eighteen states have sued the federal government over the executive order, showing the legal challenges the president will face.