Yes, it seems strange because he was LEAVING the US. My limited understanding is that the legal justification for warrantless searches by CBP has to do with making sure that people are not smuggling goods into the US without paying the required duties. I suppose that it is possible that exports could violate laws like the Arms Export Control Act.
3 Likes