Marijuana was legal in California for recreational use when that episode was filmed. Practically speaking, the Jeff Sessions era DOJ would prosecute you anyway if you were selling because they'd claim you could sell to non-Californians, but they had no cause to prosecute California residents for personal use and never did. We'll see how the Merrick Garland DOJ ends up treating it.