It may or may not be the best policy, but I disagree that it is "absurd." If we were a nation of sovereign citizens, that would be one thing. But we're not. We live in a society, where we have undertaken quite extensive obligations to each individual. At least where I live in Maryland, we have committed that we will pay for the medical care of each individual below 133% of the poverty line. Unlike some states, we do not deny benefits based on drug testing. Indeed, if you're a drug addict, we'll even pay for your treatment at the public expense.
In that context, it is not "absurd" for the government to regulate (1) behaviors that could cause people to become a liability to the welfare system; (2) behaviors that could prevent people from being productive contributors to the economy that funds the welfare system.
For example, as to marijuana, which is a relatively mild drug in the grand scheme of things, there are studies showing cognitive impacts even after the high wears off: https://www.nbcnews.com/health/kids-health/marijuana-may-be-...; https://www.scientificamerican.com/article/what-pot-really-d...
> A slew of studies in adults have found that nonusers beat chronic weed smokers on tests of attention, memory, motor skills and verbal abilities, but some of this might be the result of lingering traces of cannabis in the body of users or withdrawal effects from abstaining while taking part in a study.
Likewise, studies show that the number of people trying marijuana for the first time doubled after it was legalized in Canada: https://www.businessinsider.com/since-pot-was-legalized-in-c....
Maybe, on the balance, legalization is still the right call, at least for marijuana. But, in a developed welfare state, the government has the right to make that judgment and legislate accordingly.