The military still very much has company stores, company housing, really the whole company town concept is very much intact. It works, and has worked since WWII, because getting shot at is a strong disincentive to work for the military. Pacifism doesn't help either. But the net effect is that saving money on housing or recouping paychecks through the company store isn't exactly the long pole in the tent for the organization's success. Retaining skilled workers is far and away the long pole in this tent.
In general, the military also provides housing mainly for people who can't afford the local economy, or are frankly better off not making all their own financial decisions, and a few senior officers where it's better to keep them on base. The "skilled worker" group is still living on the economy, buying houses.
So, I would hypothesize that whenever companies are people-starved for the long term, due to systemic pressures, offering company stores and company housing as a benefit aren't such a bad idea, at least from the company's perspective. But they're still rentals, so really best suited for new grads trying to wait out the market (a strategy I definitely recommend). The company store ... who doesn't have a company store?
Until the labor-based enterprise running them faces some sort of competition, and really has nothing else to squeeze.