First of all, I am not a lawyer, I do plan to become one however, and therefore I am very eager do some "thought experiments" in regards to law. Also I am from Latvia and I am familiar with how the law hierarchy works here. I have some very basic knowledge from my high school law lessons, about how my question works in Latvia(As mentioned on my bio, I am about to start my studies), however I am interested in hearing from both European Union setting as well as The United States. So as for my question - I stumbled upon this discussion on reddit and started thinking, what if country X just passed a law that grants marijuana the same legal status as for example tobacco. A code of conduct in a workplace A objects any use of marijuana and punishes their employee for a failing a single test by a small margin by relieving him from the duty. As far as I know, in the hierarchy of law, a company's code of conduct, must comply or in other words "is under" the actual laws of employment, etc (That is at least how it works in Latvia). So unless the employee was under such an influence that would hinder his ability to work and this has been a regular occurrence; was it a lawful sacking? This is my first question here, so I hope that this is an appropriate way of asking.
There are two different concepts of "being legal" underlying your question. When we say that tobacco, alcohol or marijuana "are legal", that means that it is allowed in some context to use or have such things. These things are not completely lacking in restrictions, for instance they can't be sold to or possessed by minors, their distribution is highly regulated and taxed, and in the case of marijuana, there are limits on how much one can have. A distinct concept of "being legal" pertains to rights, such as the right to be gay or black – there can't be a law punishing a person for being either thing (although there used to be such laws).
The concept of "rights" generally describes a limit on what the government can do to you, but it has been extended to cover non-governmental relations. It is "legal" to be a silly idiot, and it is also legal to refuse to hire a person who is a silly idiot. It is "legal" to be female, but it is not legal to refuse to hire a person who is female. This is because we have a set of complex civil rights laws that explicitly restrict relations between individuals, especially when business is involved. For various kind of actions, there are "protected classes" recognized by law, and in fact you have to look at the specific business relation and the corresponding protected classes (that is, there is no single law that defines the protected classes).
An employer in the US has complete liberty to impose conditions on employees, except those that contravene specific protected class regulations. I have the right to wear a pink shirt in public, but I do not have the right to wear a pink shirt at work, unless my employer allows it (or at least doesn't forbid it). "Being a pink shirt wearer" is not a protected class in the US. Even though being a smoker or drinker is legal, it is not a protected class. If it were, my employer could not prevent me from showing up drunk.
An employer has broadest liberty to restrict employee conduct on the job, so that you can't smoke at work (in fact, an employer usually does not have the option to allow it, since workplace smoking is broadly illegal). An employer also has a right to regulate employees off-the-job conduct to some extent, especially when it potentially affects their work. Drug use is the obvious case. Even if you don't shoot up heroin on the job, your habit will materially affect your ability to do your job, and employers have the legal right to prohibit such activities even off the job. Drinking and smoking have potential to be "workplace relevant" since those activities can affect your health, and given the legal connection of health care to employment, the employer has a legal interest in your health. There are untested margins on this right of employers, so we don't know if the courts would allow an employer to fire an employee for wearing a pink shirt off the job. There are legal restrictions on "conduct unbecoming" which allow an employee to be penalized (sacked) if they behave badly, in a manner that brings disrepute to the business.
It is unlikely that any jurisdiction would have a law that literally grants marijuana the "same legal status" as tobacco. Instead, it is a popular way of talking about how former strong prohibitions are weakened, so that one this is "most like" another thing.