As a retired Senior Chief, I am embarrassed by the COBs actions. I know that most ships/boats have dress codes of what you can wear on liberty, but really....
My rule, was as long at it was neat, clean, pressed, and in good taste (as in not vulgar t-shirts) then it didn't matter.

I have been on ships where the officers were required to wear a sports coat on liberty, so I guess it's a ship by ship (boat by boat) thing.

Still...I would think he had more important things to take care of.