
The purpose is to keep drugs out of the bar along with all the issues that come with it. As an owner I could see the desire in doing this as many drugs cause rash behaviors and deals gone bad are never good.
You might lose some business to start but in the end you might gain better customers as they would feel a bit safer at your place. Less chance of some one lacing your drink or some other silly thing.
testing people for drugs is not going to stop people from lacing drinks. People can still bring drugs into a bar or pub and still prey on others by giving them some other substance. I think that this rule is not a good one and I know I will not go into any bar that wants to give me a drug test.