Earlier quoted context omitted.
You probably forgot to consider how much money / effort have Google wasted on projects that did not pan out. Their flagship products, like Hangouts, still have long-standing issues. Nobody is perfect, and making a good and desirable product is hard.
Since Ruth Porat came in as CFO Google has reduced other projects spending to $3.5B p.a on $80B of revenue - less than 5% Mozilla has revenue of $420M p.a - I don't know what they spent on Firefox OS but it would have been a big bet (hundreds of millions?). At the same time their Firefox marketshare was reduced.
Plus, I think that view - that FF marketshare was reduced, therefore they weren't investing in it enough - is shortsighted. The improvements that have been landing on FF lately are the result of work being done for a long time. And you can't just dump more money into a project and expect it to be finished sooner - see The Mythical Man-Month.