Terrible analogy. This is not sponsoring but research. Google didn’t just give money in exchange for publicity. Google has traditionally invested in fundamental research that isn't commercially potential, at least in the short term.
If a tobacco company invested in lung cancer research that resulted in some treatment breakthroughs, that research should be celebrated, while their main business should continue to be condemned.