If I had to guess, I'd say that the Navy outright bans other drug use because, along with them being illegal, there is no way for them to objectively test if you are actually high when you show up for duty. There is only a way for them to test if you have used the drug in the past X amount of time. It has nothing to do with "long term effects that are detrimental to one's ability to perform," since alcohol has similar long-term effects that can be just as, if not more devastating than MJ - impaired prospective memory, liver damage, insomnia, weight gain, heart problems, etc. If the reason that we don't permit MJ is possible negative effects to one's long-term job performance (which, to accomplish, one would have to smoke A LOT of weed), then we also should not permit servicemembers to drink alcohol.
Our current drug laws make no logical sense if we are going to draw the line in the sand at alcohol and then subsequently outlaw a myriad of drugs that are less dangerous than it.