Blame the stock market. Once a company has a solid product line in one area that doesn't suck, every publicly traded company is under tremendous pressure to move into new markets rather than iterating on previous successes, often to the detriment of preexisting products. The stock market for tech companies rewards growth and just about nothing but growth (and punishes a lack of growth), Amazon being a perfect example. In a way, Amazon's strategy since its inception could be characterized as playing to investor expectations of growth more than running a business.
Also, if you look at all the big tech companies (American ones at least) over the past 30 years, there's a recurring pattern of a company becoming preposterously successful, then spending a decade or more reaping the benefits of that success while repeatedly throwing money at the wall for different new projects to try and find something else that sticks. Meanwhile core businesses can lose focus and wither on the vine while huge piles of money and engineering talent get wasted on things that either go nowhere, or break even and fade away years later.
Until the last few years, post-1995 Microsoft was a perfect example of this. If there was a product category that was significant enough to be the basis of some other company's entire business (dialup Internet access or search engines or personal finance software, for example), they would spend many years and billions of dollars creating a Microsoft version of that product, based on the idea that they could siphon growth from a known and already-proven segment of the industry. I don't think this was due to a lack of vision or incompetence, I think that that just appeared to be the most effective way to meet investors' demand for growth and new revenue sources.
Google is in a similar bind. Think of how long it's been since they have effectively attained a search monopoly. They created a perpetual money machine (ads) that to this day provide the vast majority of their revenues. For 15+ years they have been expending titanic resources on trying to find a way to transition from a company that gets >= 90% of its revenue from ads, to a much larger company with many more revenue streams. They've had some great successes, but they have yet to break out of the trap of fundamentally being a company driven by ad revenue.