Manipulating the laws to generate more captives so that you can force them to work for you so that you can make more money is...totally exploitive. That you've thrown in higher pay doesn't change that; it just means they'd treat their slaves better.
It's also a silly hypothetical, in that it misunderstands the motive for prisoner labor. Replace "prison" with "community center":
> Imagine an hypothetical situation in which a community center teaches its occupants to code, pays them market wages, and turns a profit.
Compare potential outcomes. Wouldn't that be a lot easier to run and couldn't you expect much better outcomes? Of course. And it's also true for any other kind of labor; equally paid non-criminals with specific inclinations to the work doing it by choice are going to outperform prisoners if you're paying them equally. Which leads us to the actual reason why prison labor is even a thing at all: because it's coercive and thus artificially cheap. There's no other reason to do it! If prisons had to pay prisoners market wages, there'd be no reason to employ them at all; they could just employ other people. It's just not a valid hypothetical.
It's like saying, "we could get rid of traffic problems by not allowing any vehicles on the road."