If you have broken the law in the past, the clearance processes mostly seem to care that a) you acknowledge it and have stopped b) you are upfront about it, and it can't be used as leverage against you.
If you're currently routinely breaking the law, yes, it's going to be hard to get clearance. That seems pretty reasonable to me.
generally they don't take weed to seriously, but want to know you've been drug free for roughly a year.
By comparison, several / most of the Cali tech firms I've worked for / with / around had devs hitting a THC vape at lunch. Might have had to pass a piss test to get the job, but that's just 30 days, and no one is knocking on your neighbor's doors to verify your drug and employment history.