The capacity to operate prisons at that level is comparatively recent - there's the constant resource expenditure involved (which is a lot easier with current levels of food production, energy production, etc.), and then the material and construction costs of creating prisons in the first place. The latter of these gets really important in sufficiently ancient settings, prior to the development of any real masonry.