It's a common trope to say it's their duty to shareholders, but it's not. Their duty is to be diligent and transparent to their shareholders, but not to pursue short-term profits at any and all costs no matter what. Specifically, there is no legal requirement or duty for companies to be anti-union.