In most states employment is at will, so they can fire you because they don't like your shirt if they want to - they don't need a "good reason". And there are plenty of jobs where even prescribed medication can be an occupational safety issue, so the legality of the drug isn't necessarily the issue if the drug interferes with alertness, cognitive function, etc.