They donate to Democratic candidates at roughly the same rate. Does that counterbalance the harm done to trans people?
But I think it's more proactive than "donating to whatever candidate supports a piece of legislation favorable to them as an enterprise". I think it's more like "donating so that the candidate will support legislation (not just one piece!) favorable to Google as an enterprise". That is, I think it's more proactive than reactive. Google wants politicians to like Google before they're deciding which legislation to support.
I'm definitely willing to concede that in many cases it's a little bit of column A, and a little bit of column B. Probably.