IMO, that's not really fair - at least for barracks. And I don't really think that "married" house style housing really applies since it's a suburb that just happens to be inside the base.
1. You don't own your barracks room. You generally don't have any ability to change furniture, appliances, paint, etc.
2. Barracks typically offer little privacy - there are periodic inspections, limits on guests, etc.
3. Military culture is a bit weird - there is often a very strong drinking culture, etc. It's not clear to me that the same social forces exist for a civilian live-work building.
4. The barracks are sometimes raided for off-hours extra duty. This downside doesn't really exist in the same way for civilians.
Yet. "Ron, according to the security system there was movement inside of your company dorm room last night at 8PM when we emailed you. Since you were just at home anyway why did you decide to not be a team player?"
"The barracks are sometimes raided for off-hours extra duty."
Unless you work in IT and are on-call or the on-call doesn't answer (not fully the same, but still...).
Even though work and housing aren't in the same buildings, military housing can provide a good lens into this.