(There's a persistent myth to the contrary, but it's not really rooted in law; see e.g. http://truthonthemarket.com/2010/07/27/the-shareholder-wealt... and http://hbr.org/2010/04/the-myth-of-shareholder-capitalism/ar... ... and even if that weren't true, courts are willing to grant considerable leeway to business strategies such as "building goodwill" and "increasing positive sentiment towards the brand", since courts aren't in a good position to second-guess a duly elected board on such points).
I tend to think of it as the board being in possession of the company that the shareholders have all but signed over to them; with shareholders retaining notional ownership, mainly enforced via the rarely exercised right to revoke the delegation of power if they get sufficiently angry.
Regardless; Apple is not going to space, at least not until it can figure out how to make money doing it.
The main enforceable obligation is a negative one, to not actively do things that benefit themselves at the expense of the corporation they oversee, e.g. by making decisions primarily designed to enrich themselves personally. Almost anything that isn't active wrongdoing is defensible though; if a board member thinks in good faith that doing X would enhance the goodwill towards the Apple brand, and in good faith thought that prioritizing brand goodwill was the best long-term strategy, it would be fine to undertake a short/medium-term money-losing course of action to pursue the strategy. Courts generally defer to board elections to resolve those kinds of disputes over strategy, since courts are very bad at predicting whether a given strategy is actually in a particular entity's long-term interests.
Insurance these days is more often directed at government regulations than shareholder lawsuits; board members have various possibilities for personal liability if their company is doing illegal things on their watch.
However that doesn't preclude them from doing good with it, even in money-losing investments, beyond perhaps shareholder revolt ousting the board. There's an oft claimed belief that corporations are somehow bound by corporate law to do everything in their abilities to increase profits/returns for their shareholders. That is not and has never been true. Corporations are essentially mini-democracies, albeit where your say is scaled by your ownership: If the shareholders don't like it they have mechanisms to deal with it.
but that doesn't really need to bother them
Oh yes it better bother them. Cook and the Board have a fiduciary duty to the shareholders. They can't just go spending money however they want without regard to shareholder wishes or stock performance.Hence today's dividend announcement.
Plus, a company's #1 goal is to create shareholder value.