I don't even use weed (or any other drugs), and I wouldn't work anywhere that required me to be drug tested. I expect to be treated like an adult. Likewise, I'm not going to produce a note from a doctor if I'm taking sick leave.
I have a few friends who work as project managers and engineers on railways (two for a metro system, one for the long-distance trains).
They're all subject to random drug tests, under the same policy as the train drivers. I think it's done to be fair to all staff, whether their current work is in a potentially dangerous position or not.
However, in the world of software, I'd never even consider applying to a company that bans drug use. It's none of their business what I do after work and there's practically no liability at stake for a large majority of the work that I do. I'd be insulted if asked to take a test, and I'd quit on the spot.