I mean, subject to a variety of risk and regulatory issues, perhaps, and not a core competency, and a variety of other things, but... the fundamental reason for insider-trading laws is to make sure the insiders don't abuse their positions and act against the interests of the company's owners (shareholders) by trading in stock tips instead of building shareholder value. If you get knowledge independently -- like if you sent your analyst out to count the number of cars in a firm's parking lots to estimate hiring/firing -- that's all well and good (and is something that hedge funds actually do.)
Heck, if it works, this sort of thing would be great. Moving the market earlier means fewer people buy and sell companies at the wrong price. That sort of knowledge is worth billions. (Think about it from the perspective of startups: if you could see the future and know whether a company would work out before you even founded it, then you would build only successful companies, and you'd be certain they'd be funded well. This is but a small fraction of that power, but it's still quite meaningful.)
The legality of information you obtain is not about whether you obtained it independently, but based on whether it is public knowledge (or can be derived from it) or not.
Let's say you are not connected to company X, but you have a friend that works there. One day your friend tells you material fact. Now, your friend probably broke a couple of rules, but _you_ cannot control what people tell you and you cannot be held liable for what you hear. However, acting on this information is illegal. Even if you presumably do not use this information, but trade shares of company X before the information you know becomes public, you are in murky waters.
Same with Google. Google cannot control what people search for. However, acting on this information would be illegal, unless they are absolutely sure that information in the search terms is consistent with public knowledge about the company.
I believe this is not a fully accurate picture, although the example you give in your second paragraph is definitely accurate.
At a high level you aren't allowed to use "material, non-public information" for investment purposes, but information isn't material just because you can make money off of it in some way, otherwise "channel checks" would be illegal. Material non-public information has to come from insiders of the company, so the only argument that could be made that it was illegal for Google to make investments is based on material information that was being provided to them, via search terms, by corporate insiders. If they are merely using the sentiment exposed by the public to them through search terms that is probably legal. Similarly it's legal for hedge funds to fly planes over department stores and count the cars in their parking lots to gauge the level of business they are seeing at Christmas time, even though this isn't public information.
I mean, subject to a variety of risk and regulatory issues, perhaps, and not a core competency, and a variety of other things, but... the fundamental reason for insider-trading laws is to make sure the insiders don't abuse their positions and act against the interests of the company's owners (shareholders) by trading in stock tips instead of building shareholder value. If you get knowledge independently -- like if you sent your analyst out to count the number of cars in a firm's parking lots to estimate hiring/firing -- that's all well and good (and is something that hedge funds actually do.)
Heck, if it works, this sort of thing would be great. Moving the market earlier means fewer people buy and sell companies at the wrong price. That sort of knowledge is worth billions. (Think about it from the perspective of startups: if you could see the future and know whether a company would work out before you even founded it, then you would build only successful companies, and you'd be certain they'd be funded well. This is but a small fraction of that power, but it's still quite meaningful.)