See all rules and policies are adapted internally with in the organization in order to get right candidate for right job. In such cases, we can consider hiring the candidate who failed in drug test by making sure that he/she can able to do the desired job in a better way. Purely the decision is depends upon the kind of job and the status of the candidate which is held in all the rounds of interview. Moreover we can get to know the candidate's medical fitness through this kind of test.
Also, to mention, it depends upon sector you are going to work with. For eg, if you'll go for sector such as Food & Beverages, Food Retail etc, wherein under FDA Act, all the employees dealing with need to compulsorily undergo pre- Employement Health Check up as well as require Food Handler Certificate from Medical Practioner.
However, as Priya mentioned earlier, that the same practice has been adapted internally & depends upon the job requirement.