Preobrazhensky's "socialist primitive accumulation"[*] involved the city exploiting the countryside, not prisons as exploitative institutions. It didn't refer to prisons. (It also didn't refer to what Stalin did. The latter took Preobrazhensky's ideas to their illogical extreme.)
Prisons, and work camps of other sorts, usually involve work for the inmates -- in order to try to cover the costs. (Guantánamo is an exception here.) But few, if any, actually make a profit. In general, forced labor is only good for rather simple work, like picking cotton, and a lot of economic historians (such as Gavin Wright) argue that the reason why antebellum US Southern slavery was profitable was the artificially high price of cotton at the time. Whether this is right or not, slavery and other systems of forced labor usually go along with short supplies of labor-power; if labor-power is abundant, then (to simplify a bit) supply and demand keep wages down and profits up. Forced labor also is basically biased against technological change.
Thus, prisons aren't "economic" institutions as much as part of the coercive apparatus of the state. The Gulags helped maintain order and the system of class power, just like Pelican Bay and similar US institutions do. Guantánamo, abu Graib, etc. help maintain US imperial domination over Iraq, Afghanistan, etc. Because of these goals, any work done or not done by inmates is of secondary concern.
How do you know that "[b]uilding the pyramids was easier"? Have you done research on this subject? did you poll the Egyptian slaves?
[*] By the point that Preobrazhensky developed these ideas, the class situation in Russia had gone quite sour (from a working-class perspective). It should have been called a proposal for statist nationalist primitive accumulation or something like that.
JD