How the Fourth Amendment applies at or near the border has been a very tricky question for a long time, even before 9/11. It involves our concept of national sovereignty, although the current President does not give a damn about that. (Neither do the many RINO's who serve as his butt boys, for that matter.)
The Fourth Amendment does not apply to searches and seizures by U.S. officials in foreign countries where an alien is involved. So, evidence obtained by U.S. agents during the warrantless search of an alien's home in Mexico was not barred by the Fourth Amendment, as it would have been if made in the U.S. under the same conditions. See U.S. v. Verdugo-Urquides, 494 U.S. 259 (1990). And at the border or its functional equivalent--e.g. a nearby point within the U.S. where several routes leading to the border converge--the Fourth Amendment does not apply either to non-citizens
or citizens.
When the emergency is severe enough, the old line by a Supreme Court justice that "the Constitution of the U.S. was not a suicide pact" comes into play. Even open race discrimination may be permitted, as it was when the Court upheld President Roosevelt's executive order relocating persons of Japanese ancestry away from the West Coast after Pearl Harbor. By the way, anyone who thinks there was no good reason to do that might want to read about the several Japanese submarines that operated along that coast during December, 1941. Merchant ships were attacked right outside the harbors at Portland, Oregon and Santa Cruz, California and had to beach themselves to escape sinking. A submarine fired a number of shells from its deck gun at oil tanks near the shore north of Santa Barbara.
They might also want to read about a Japanese pilot who had crash-landed on a small plantation island after being hit while attacking Pearl Harbor. This remote island--which the Japanese mistakenly thought was uninhabited--had been designated as a place for planes that could not make it back to their carriers to ditch. They were to radio a sub cruising nearby to arrange to be picked up. Most of the several hundred inhabitants were native Hawaiians, but a handful were Japanese. Several of the Japanese the pilot first encountered refused to help him, and in the meantime, one of the Hawaiians, suspecting trouble, smartly took the radio out of the plane and hid it. But the Japanese who ran the general store and his wife befriended the pilot, put him up at their house, and treated him to home cooking. They soon found out who he was and what had happened.
But they were the only ones. Because there was only a single radio on the island and reception was spotty, it was more than a day before the other locals learned of the attack and made sense of the mysterious crash-landing. All this time the pilot had become more and more desperate to retrieve his radio. Finally, as the islanders were assembled for their weekly festivity, he pulled his small pistol and loudly demanded to know who had it. And the storekeeper, who had the only other firearm on the island, a shotgun, threw in with him and started waving the weapon around. But when the threatening pilot tried to grab one of the women, her burly husband overpowered him, beating his head against a stone wall and finishing him with his fishing knife. The storekeeper, seeing his desperate attempt to help Japan had failed, then shot and killed himself.
President Roosevelt of course knew about all these incidents. He also knew that in addition to the several hundred Japanese agents the FBI was trailing in Hawaii, Japanese communities near Seattle, on Terminal Island near L.A. harbor, and in other places included a small number of agents who were passing military information to Tokyo. All this puts his decision about relocation and internment in a little different light.