I am not a lawyer but IMO the constitutional situation in the US is such that the federal government and the governments of the several states share sovereignty. This can be clearly seen in the structure of the US Constitution and the existence of such things as separate state law codes in the states. Municipalities in the United States have no sovereignty. They are altogether instruments of the state governments or in the case of the District of Columbia, of the US Congress. State laws automatically apply within the cities contained in the individual states. In the same way the principle of the supremacy of federal law applies to the states and the cities with them. This principle is very popular with left when they are in command of the federal government, but not so much when the right is in charge.
Therefore, IMO ,there is no basis in law for cities to defy federal immigration law. What has emerged in this area of law is something similar to the defiance of federal law by the states with regard to marijuana. pl