A. if you are caught smoking on the job whats going to happen.
B. Most jobs can subject an employee to a drug test if they have reason to suspect they are on drugs. So if you walk into work enough times and you are noticeably high you're likely to be tested.
It comes with the territory. There is an image these pro sports leagues are trying to uphold.
You're right at the most general level: the NFL has the right to choose to ban and test for whatever they want* (assuming the players' association agrees, of course). Even if marijuana use has been legalized in Washington and Colorado, the NFL has not done so (and likely will not, at the very least until a theoretical national legalization).
However, you are making WAY too many assumptions and jumping to WAY too many conclusions when it comes to your underlying arguments.
*And it should be pointed out again that when the NFL (and other leagues) have such a terrible time with alcohol abuse and the ancillary effects (mostly drunk driving and fights) that come along with it the idea that they take such a hard line on certain substances and not others is ridiculous.