There is nothing legally or ethically wrong with this strategy. Around fifteen years ago...Microsoft threatened the US government with the hint that they might take the company to Canada. They ended up with some great deals, which were compliments of various Senators and Congressmen.
I would imagine that half the major companies left in California today....are looking at the idea of moving their operation out.
Some might see it as ethically wrong were they to gratuitously pay higher than required taxes—and earn less than they could for their shareholders.