Google made it clear that these sorts of laws affect its ability to keep the best talent in their company. Also, in the legal sense, being able to apply the term "married" to two people shortcuts a lot of overhead for establishing employee benefits. It defines a legal contract between the two people which does not need to be reviewed in extreme detail by the HR department. Without it, each couple could have entirely different sets of contracts that define their relationship. This could lead to two things: 1) very lenient interpretations of who can get benefits, leaving a lot of room for abuse by fake life-partners; or 2) the need for costly legal fees to determine which side of the line each contract falls.
The result of all of this is that Google's bottom line is negatively affected by laws created by religious zealots, and making money, like with any other corporation, is a Google thing.