To play devil’s advocate, this has more to do with the concept of sovereignty. A country can choose who gets to enter its borders. We may or may not agree with the rules they impose but they can set them. The constitution only applies to people that are already on US land.