This is a movie plot notion of how M&A works. In reality, just because you have the assets on hand to buy another company, doesn't mean you can just go ahead and buy the company. First, you have to convince your own board, and then your public shareholders, that the acquisition makes long-term business sense.
Oracle bought Sun on a business model that saw them recouping the price of the acquisition not in proceeds from lawsuits but in shoe-leather sales to Oracle and Sun customers (which overlap intensely). Oracle already had the infrastructure to capitalize on that channel with Sun products.
Google had none of that. Had Google bought Sun, the first thing they could have expected would have been a shareholder revolt. The money isn't theirs to spend; it belongs, in large part, to Google's shareholders.