You can rent out that investment if you move. Paying rent is also expensive where home prices are expensive.
If you pay a property manager 10% to make it their problem, the economics of paying a mortgage on a home you're no longer living in and renting it out become significantly more questionable - particularly in some place like the Bay Area, where mortgage payments are already often more than you would pay to rent the equivalent dwelling.
Otherwise, there’d be a line to file strategic bankruptcy after the last tuition payment was due...
It's a mild deterrent for some cases, but for a lot of situations, having the degree isn't anywhere near as valuable as having the education.