Border searches are special case in US law where the 4th amednment protections aren't as strong. See the EFF page about it for more:
https://www.eff.org/issues/border-searches