It is not explicitly a class issue, it is insurance companies looking for any reason to get out of paying a claim, and testing positive for drugs is one of those reasons.
My guess is this comes about because insurance companies will dodge claims due to a positive drug test, but an injured worker could still sue the company. So, companies don't want workers that would test positive for drugs in the event of a work related injury.
Warehouse workers are relatively likely to get injured at work. SDEs are not.