If it was derogatory he could've been asked to stop. When he didn't, I imagine he could've been arrested for trespassing and all the rest (including strip searching) can be explained as "normal procedure".
I'm not arguing it is right what the town did, it is obviously very wrong. Getting his case won might not be so easy, but it definitely succeeded in highlighting the problem in that town. Will it lead to change? I'm not sure.