As I understand the law, he could have stayed and appealed the decision. Not that they're going to tell you that or help you out - they're allowed to lie to you and so on.
Strip searching seems very excessive, as does the entire handling. But fundamentally, interrogating someone that appears to be going to violate their visa is one of the reasons for having CBP at all.