Management operates the company for the benefit of the owners. Preempting the owners' decision to sell by making the company a less attractive target should not be within their remit.
If a company's "owner" is mainly short-term money, then any publicly traded company is vulnerable to takeovers that destroy long-term value in favor of extracting cash in the short term.
For example, imagine a scotch distillery. For the last couple hundred years they've been reliably producing scotch, with their most common version aged 12 years. They've got solid people, many of whom spend their whole careers there. They have a very well-regarded brand; sales and profits are solid and consistent.
A corporate raider buys them. They immediately stop putting new whiskey in barrels, fire anybody who has been there more than a few years, and start selling off property and distilling gear. This frees up a lot of cash, making quarterly results look great. They then increase sales volume 3x by buying inferior whiskeys and selling it under their brand while increasing marketing. Quarterly numbers look even better. The raiders load the company up with debt, extracting cash, then take the company public. There is some grumbling from whiskey aficionados that it's "not the same", but the public, looking at the strong numbers and the beloved brand name, eagerly buys the stock.
A few years later, as the aging whiskey runs out and the lowered quality harms the brand, sales fall. Interest rates go up, making the debt hard to manage. The house of cards comes tumbling down and the company declares bankruptcy. People mourn the loss of a once-great distillery, many good people are out of jobs, and a lot of stockholders take a loss on their tax forms. The raider uses its now-larger cache hoard to repeat the process elsewhere.
An outcome like that is within the current rules of business, and is depressingly common. But it's not why we as a society provide for and support the whole notion of companies. Sure, sometimes takeover defenses are management getting comfortable. But "management operates the company for the benefit of the owners" is an ideological statement, not a descriptive one.
That just means companies have to be valued high enough so they're not vulnerable to the 'raiders'. However, if that's not the case then there may be a fundamental problem with the long term prospects of the company. It may be better indeed to use the capital of it for something else.
I get that economic theory can be a useful way to look at actual productive relations in the world. But it's just a theoretical model. If we find that following the theory leads us to behaviors that destroy the things economics was created to describe, we should stop to ask ourselves whether we could use a better theory.
If you're going to make $100m from a scam, you can afford to make it look pretty convincing. Way more convincing than the average amateur investor will be able to ferret out. There's an inbuilt information asymmetry.
The theory of public stock markets is that they are well-regulated enough for individuals to invest safely. Either we make that true or we should close the markets to unlicensed amateurs. Blaming victims is always popular, but it never leads to change. (Which is a big part of why it's popular.)