Came to say this so thanks for being so clear.
In Palo Alto I've seen an additional nuance. When I first moved here (1984) houses were underwater and there was lots of student rental. As Stanford built student housing, most of the houses became single family but there was an aggressive effort to keep the environment diversified (e.g. two SRO hotels downtown, section 8 requirements, and a lower median income than surrounding towns).
Then in the late 90s/early 00s the real estate interests took over the city council. It was in their interest to restrict supply for the reasons you stated; if you built it was to build larger, higher priced units as replacement for existing stock which are marketed to newcomers. It's great to have new neighbors, but when you move in and worry about the cost of your mortgage, you aren't really interested any more about the structure and balance of the community.
Taller buildings have been resisted as have most new multifamily residences. As a result, the median income has shot up, teachers, cops, firefighters and the like can no longer live here. It's a different and much less interesting place.