Los Angeles ' ban on new medical marijuana dispensaries is invalid , a Superior Court judge said Monday in a decision that undermines the city 's 4-month-old drive to shut down hundreds of the stores .