As housing costs rise and teacher pay stagnates, cities and school districts are building education workforce housing to attract and retain educators—cutting commutes and strengthening community ties.