that's if you take the government as a whole. I don't know the details and especially the situation over there in the US, but I do know you have private prisons over there fpr example.
and eventough it costs the government as a whole money, that is taxpayermoney coming from the population, the money the prisonboss makes goes all straight to his pockets, and maybe something flows back to the politicians who help him make more money.
so it could all just be a kind of moneylaundering, but instead of 'black' illega; money made trough crime converted to legal, companymade money, it's the conversion from taxpayermoney, wich is limited by law and voters as where it can be spend, to private money that can be spend anywhere
if a politician would spend taxpayermoney directly on luxury for himself(or herself), he/she would eventually get in trouble, journalists investigating it, voters coming in protest etc.
if this politician spends the money on purposes the voter sees as legitimate, for example the war on those evil, evil drugs, and then the money flows back to the politician somehow, trough shares, or a highpaying job after his/her term is over, he/she can spend it on luxury without getting in trouble.
no idea of this is actually going on, but it could.
so it doesn't have to make the goverbnment money, just convert money to a use-able form