The "company" is nothing more than a Tax ID number. Yahoo's directors MUST (not "should") do whatever maximizes profit for shareholders. This isn't an opinion, nor what's socially correct, but those are the rules when you issue shares to the public on U.S. stock markets.
This line of thinking is responsible for many of the problems with the stock market, and the economy, and this country to a larger extent.
The reason companies sell shares is they want to do their business (make doohickeys, sell services, etc) but they need money to grow the business. Investors are investing in the company on the idea their money will be used to improve the business and in return they will get dividends and the business will becomes more valuable -- which will in turn lead to a share of the company becoming more valuable. The purpose of the company is not "convince the stock market we're worth as much as possible". Anyone who believes this is still living in the Bubble delusion that the stock market is nothing more than a lottery and the reason you get into it is you want your horse to get as high on the price board as possible before it dies.
And a wish to increase profit does not mean the people running the company are absolved of all social responsibility in the decisions they make. "Hurr-durr, we can run sweatshops in undeveloped countries, rape babies, dump toxic waste all over, run our industrial plants in ways where the employees will get cancer, and it doesn't matter because we aren't doing it really -- the Company is, and the Company MUST maximize shareholder profit -- even if that means doing things like using high priced lawyers to screw consumers hurt by our products and bribing government officials to get unjust laws passed that favor us. Who caress if it's not "correct", it's BUSINESS!"
Do you really believe that's how the world is supposed to work?