Is it legal for pilots to transport or use marijuana?
Is it legal for pilots to transport marijuana within states that have legalized it?


This I'm not sure about. I can't find any FAA regulation or guideline on it, so I think it would depend more on specific state statutes. The problem would lie in going over state lines, obviously, but intra-state transport is unclear. If you were ramp-checked by an FAA inspector and had marijuana on board, they would probably require you to get a drug test, and if failed (according to the next part of this question) you would lose your license (actually your medical, you would keep the license but be unable to use it). So it may be legal to transport it, but you certainly can't be the one using it.


  Can pilots use marijuana recreationally if their state allows it? Are there implications for medicals?


Negative. AME's have marijuana on the DNF/DNI (do not fly/do not issue) list:


  Controlled Substances (Schedules I - V). An open prescription for chronic or intermittent use of any drug or substance.
  This includes medical marijuana, even if legally allowed or prescribed under state law.


While the guidance just says medical marijuana, I would suppose that it includes legal recreational marijuana as well.

Since you would be using a controlled substance on the DNF list, you would not be eligible for flying under the BasicMed either:


  A diagnosis or medical history of substance dependence is disqualifying unless there is established clinical evidence, satisfactory to the Federal Air Surgeon, of recovery, including sustained total abstinence from the substance(s) for not less than the preceding 2 years. A history of substance abuse within the preceding 2 years is disqualifying. Substance includes alcohol and other drugs (i.e., PCP, sedatives and hypnotics, anxiolytics, marijuana, cocaine, opioids, amphetamines, hallucinogens, and other psychoactive drugs or chemicals)


Another way to look at it: Since pilots licenses are issued by a Federal authority, the Federal rules apply. According to Federal laws, marijuana is illegal and your license (or medical) is not valid even if the state you are in allows it legally. Marijuana is still a Schedule 1 substance (on the same level Federally with Heroin and LSD).