If you're already accruing the supposed negatives of being associated with the industry (and I emphasize supposed, given that tech is also the region's biggest economic driver these days), you might as well have the dollars too. Tech companies are struggling to hire people in the Bay because of the housing crisis, it's entirely rational that they would start supporting efforts to fix the problem. At least in this case corporate interests are mostly aligned with public interests.
This assumes that your only two options are give them the money or not give them the money.
They could give that money to someone else, e.g. to some of the low income housing groups that have existed for a while and who have not been pegged as tech proxies already.
That doesn't help with the problem that the companies are trying to address, which is that their own employees and hires are having trouble finding housing.