The prison’s sprawling complex essentially functioned as its own community, featuring everything from a classroom and library to a barbershop and recreation facility.