The government — via the DHS and CBP — has long insisted it should be able to search whatever, whenever, within X number of miles of the border for national security reasons. The DOJ has routinely argued on its behalf, delivering non sequiturs like “Not searching your laptop doesn’t protect your civil liberties” with a straight face.
The security/liberty tradeoff has routinely suffered from the government’s insistence that its Fourth Amendment-skirting efforts are in the public’s best interest, even if the public isn’t nearly as interested in seeing the drawers of their personal computing equipment emptied onto the floor every time they stray too close to the “Constitution-Free Zone.”
The courts have generally upheld the government’s arguments, with a few exceptions. The Eastern District of New York basically said that if you don’t want your stuff looked through for no reason, don’t put so much stuff in your stuff — especially sensitive stuff. The presiding judge, Edward Korman, went so far as to compare the US to countries with severe civil rights issues, like Syria and Lebanon, and declared the US the “winner,” seemingly because citizens enjoy more rights once they move further inland.