Apple should only do desktop PCs. Music players, that's ridiculous.
Oracle should only do databases.
Google should stick to search. What do they know about operating systems? They also have no business running their own datacenters, what could they possibly know about allocating ten billion dollars in capital annually to such an operation.
Amazon is a retailer. Cloud services, artificial intelligence, devices, is that a joke?
Intel makes memory chips, what do they know about processors?
Facebook has $41 billion in cash. They're about to start piling up $20 billion per year. Zero debt.
They can do almost anything they want to within reason and not worry about the financial consequences. Their shareholders will be a lot more upset if they don't take pragmatic business risks and pursue opportunity.
nVidia had to diversify to avoid being shoved into a shrinking niche market.
No, they need to make the soundest possible investments with that money. Lots of free cash flow is not license to do "anything they want to within reason," especially for a publicly-traded company (sure, if you're talking about a private partnership and all the partners agree, go nuts, I guess). If they don't actually need it to run the business making the profits, they should return it to shareholders since, you know, that's whose money it is.
Why would a company 'throw away' surplus cash to passive uncomplaining shareholders instead of intercepting it upstream and ploughing it back into tax-reducing activities? Like burning cash on R&D that provides opportunities for pivoting in the future. Now that is prudent and sound.
Eventually shareholders might gain enough voting power to demand dividends but there's no point in piling-up taxable cash until that happens.
Facebook has been running its own datacenters, first in colos and now fully purpose-built, for nearly a decade and a half at this point. That hardware design done by a company isn't familiar to you doesn't mean it doesn't exist.
And that's not even mentioning the now nearly four years old Oculus acquisition or the resources Facebook has been pouring into AI/ML research and applications.
[1] https://www.facebook.com/notes/facebook-engineering/building...
Doing their own ASIC design is a whole other ballgame.
iPhone is just a different form factor in that sense.
This is more like your local sandwich bar deciding to also farm their own pigs for the ham.