Cities will keep on losing this kind of battle until some form of government or policy arises to counter the power of corporations (which are de facto increasingly taking the role of governments). Under our current regulations and incentives, I'm actually glad to see Amazon flex its political capability and teach NYC a lesson in what happens when you let vocal minority dictate public policy. Let examples like this teach us how broken our laws are.
Note I am equally glad to see some day that government (federal, state) come up with policies that stop cities and states from undercutting each other to get a temporary revenue / population / popularity boost at the expense of giving away the farm just to get it (until you find out it wasn't worth it, and get to try and remember that at the next election). Or god forbid, actually create policies that in the long-term stimulate as many jobs as a corporation might in a single swoop.