I could use similar harsh, if negatively over-generic, logic to justify the rule ("I'm not paying for the health costs of some fat ass who ate so many donuts in their life they're now having a heart attack on my dime!"). But such an approach will probably not solve very much anyways except make a whole lot of people angry. People would probably hold donut-eating parties in protest. :)
One other point. At present, the current state legislative trend on drug-testing "welfare" recipients is mostly limited to TANF, with occasional forays into Medicaid and SNAP. I have seen no proposals targeting SSDI / Social Security or Medicare. There's a reason I said "caste" -- right now, the context is not people in general that are accepting money from the government, but only the "wrong" people that are accepting money from the government.
Also, I don't really the see problem with a "nanny state" in the context of people that are accepting money from the government. If you need the government to provide for you, you should be totally happy with whatever stipulations that help includes.