Facebook and Palantir both used to pay people up to $10k/year to live within a mile or so of the office, since the cost of living in SF & Palo Alto & Menlo Park was so much higher than the rest of SFbay. I don't know if they still offer that perk, but I can attest that the increased costs of rent within a mile of those offices would, at that time, burn up that entire $10k and then some, relative to the rest of SFbay.
Are they right to do this, given that it's probably a contributing factor to increased rents? Probably not. But I bet it was negotiated with the cities to try and reduce emissions and parking requirements, too.
This perk at fb was halted in 2008 precisely for the reason you mention above - it raised all the rents suitable for employees at the time within that perimeter by $1000/mo.
Similarly, I always hear people talking about how tech companies should pay their contractors higher wages to account for the cost of living in the Bay Area. But given that the largest expense there is rent, that has the same problem: if there are more people looking for housing is greater than the number of available units, all you've done is changed who gets housing, and number of people with housing remains the same.
Are they right to do this, given that it's probably a contributing factor to increased rents? Probably not. But I bet it was negotiated with the cities to try and reduce emissions and parking requirements, too.