>Berkeley attempted this and it was recently overturned: https://www.cbsnews.com/news/court-overturns-berkeley-califo...
There is a legal difference between a state banning it and a city. States have far more powers that cities don't (unless the state delegates that power which they often do)