If they don't focus on making money, their shareholders can sue them. Companies are there to make money, they can't be twisted into innovation factories. If they could we'd probably have free energy and plentiful drinking water by now.
Anyone can sue anyone for anything. (Whether or not they can do so successfully, or without being sanctioned, is another story -- I just won a nice attorney fee award from a father (lawyer) son (douchebag) team that sued a client of mine in state court, and then dismissed when we filed the Anti-SLAPP Motion to Strike I'd warned them repeatedly was coming... sigh...)
That said, the "must increase shareholder value" trope is a myth: "This common and widespread perception lacks any solid basis in actual corporate law." http://www.brookings.edu/~/media/research/files/papers/2012/6/18%20corporate%20stout/stout_corporate%20issues.pdf (p. 4)
If a business wanted to spend three years on R&D, as long as the directors embarked on that path in good faith, with appropriate consideration and care, and reasonably believed that they were acting in the best interests of the company, they'd be able to do so under, e.g., the Business Judgment Rule.