The power to “define and punish” offenses against “the law of nations” presumably allows Congress to restrict the movement of pirates and other violators of international law. But there is no general enumerated power giving Congress the authority to exclude migrants simply because they are foreign nationals or were born outside the United States.

It is true that the law of nations as it stood in 1789 (when the Constitution took effect) did not generally consider immigration to be an offense. However, it did generally consider immigration-without-permission to be an offense. Blackstone wrote: “Upon exactly the same reason stands the prerogative of granting safe-conducts, without which by the law of nations no member of one society has a right to intrude into another.” So, immigration without permission generally violated the law of nations. And, the U.S. Supreme Court has for centuries correctly said that the permission to immigrate can be either express or implied.

In short, immigration into the United States violates the Define and Punish Clause if it occurs without permission. And, Congress has plenty of power to grant such permission; if the immigration happens aboard a commercial vessel, then obviously the Foreign Commerce Clause empowers Congress to grant permission. Additionally, Congress can grant such permission to immigrate under its naturalization power.

Further questions remain, such as whether states have a concurrent power to license immigration. It seems clear from the Constitution’s Migration or Importation Clause that states do have concurrent power over immigration: “The Migration or Importation of such Persons as any of the States now existing shall think proper to admit, shall not be prohibited by the Congress prior to the Year one thousand eight hundred and eight, but a tax or duty may be imposed on such Importation, not exceeding ten dollars for each Person.”

There are two main kinds of concurrent powers: those subject to federal preemption, and those not subject to federal preemption (like the power to tax private citizens). If states possess concurrent power to allow immigration, and if that state power is not subject to federal preemption, then that would somewhat support Professor Somin’s position. But the Migration or Importation Clause indicates that congressional power to allow immigration preempts the concurrent state power to allow immigration.

MICHAEL RAMSEY ADDS: On this point, see also Rob Natelson's similar argument, summarized here.

UPDATE [By Andrew Hyman]: As explained above, the Define and Punish Clause in my view bars immigration without permission, but that still leaves the critical question of who is empowered to give that permission: the states, Congress, the President, none of them, some of them, or all of them? Other clauses answer that question. Professor Somin’s different view of the Define and Punish Clause is elaborated in this May 2017 blog post of his.