Maintaining safety and order at detention centers requires the expertise of correctional officials, who must have substantial discretion to devise reasonable solutions to problems. A regulation impinging on an inmate’s constitutional rights must be upheld “if it is reasonably related to legitimate penological interests.”The four more liberal justices dissented.
[C]orrectional officials must be permitted to devise reasonable search policies to detect and deter the possession of contraband in their facilities, and that “in the absence of substantial evidence in the record to indicate that the officials have exaggerated their response to these considerations courts should ordinarily defer to their expert judgment in such matters.”
Leaving aside constitutional issues, I've always pointed out that you should welcome a strip search in jail not because of you might be hiding or carrying, but because of everybody else you'll be with. There are a lot of criminals in jail. If I'm in jail, I will sleep better knowing that everybody else has been thoroughly searched for weapons.
Of course such logic does ignore the fact that most contraband gets into jail through visitors and correctional officers.