As the official spokesperson for the company, if Musk says it's "housing", then housing is the official reason.
It may not be the real reason (which probably has more to do with his feelings about California in general and maybe proximity to SpaceX's Texas facilities), but it's the official reason.
That's temporary and the company has to look at things long term. Austin doesn't have the geographical barriers that the Bay Area has. If the building supplies and labor are available, Austin can sprawl out in pretty much any direction, though obviously transportation eventually becomes an issue.
Compared to the Peninsula, Austin is basically free. Median home price in Austin is $575,000. Median home price in Palo Alto, where the current Tesla HQ is, is $3,488,610.
It may not be the real reason (which probably has more to do with his feelings about California in general and maybe proximity to SpaceX's Texas facilities), but it's the official reason.