I remember not being allowed to enter an unsophisticated bar down here in Key West, because I was wearing a "Tank Top" one summer evening. It cost that bar eight customers coming in to have cocktails. With the stiff competition for customers here on an island where most people live in shorts, flip flops and tank tops this seems like a foolish mistake.
There is a place for dress codes, but you have
to make a decision as to what you really want in your establishment before you start to initiate these rules. If you run a bar that is part of a high end restaurant, then there is a real reason for you to have a dress code, but if you run a beach side tiki bar that requires shoes, long pants and a dinner jacket, you will be out of business in very short order.
For me I prefer the "No Shirt, No Shoes, No Problem" type of bar, but there are those that need the more sophisticated establishments to feel really comfortable. The real important thing is to first establish who your clientele are then decide what your "dress code" needs to be to conform with the local laws and the atmosphere of the establishment. The key is not to be arbitrary, but to us the dress code to enhance the attendance at your establishment.