Since the the Founders did not include the terms 'border' or 'security' in the Constitution, it doesn't matter what SCOTUS said.
However true, therefore, it may be, that the judicial department is, in all questions submitted to it by the forms of the Constitution, to decide in the last resort, this resort must necessarily be deemed the last in relation to the authorities of the other departments of the government; not in relation to the rights of the parties to the constitutional compact, from which the judicial, as well as the other departments, hold their delegated trusts. On any other hypothesis, the delegation of judicial power would annul the authority delegating it; and the concurrence of this department with the others in usurped powers, might subvert forever, and beyond the possible reach of any rightful remedy, the very Constitution which all were instituted to preserve.
James Madison, Report on the Virginia Resolutions
------
The State has every Right to take any action it feels necessary to protect it's People, and there is no Constitutionally authorized federal authority to prevent it from doing so.
With so much focus on the Constitution lately, sadly Constitutional interpretation is growing similar to Bible interpretation.