CEOs are increasingly using jobs, headquarters, and investment as leverage in battles with elected officials—but workers and communities can end up bearing the cost.