Not sure I agree. Seems more there is a shortage of housing in SWE-heavy metro regions. I have so many friends from college who graduated with computer science degrees and ended up in non-engineering roles -- because of a total mis-match between SWE pay and housing costs, especially in the Bay Area where the jobs used to be.
Now, before anyone cites FAANG L6+ salaries, note you dont get into those after graduation, and not everyone gets into those roles. Also note, for the majority of non-public SWE roles with "high" total comp, you cant pay rent with total comp stock/equity, you pay rent with cash comp.
Also, before anyone cites the cost of a studio apartment in California, note not everyone is single and not everyone wants to stuff a family into a studio apartment.
All this may well change with WFH and remote-work, which will open up talent pools across the US and the world.