You are correct to say gambling makes it way into nearly all environment, including prison wards. It is not necessarily about money but about the need for distraction, connection socially, and a sense of control in such a place where freedom is restricted. The negative aspect is just like you said: going into debts and even misunderstanding may result to violence quickly. Therefore while it is occupying an empty space, it equally brings risk. This shows that gambling is not just all about gains, rather it's involves the human personality desiring play, risk and also escape, as well as in the most difficult situations
Gambling finds it's way into every aspects of the society, as far as you're putting something on the line to proof a point, it doesn't have to be money. It is also possible for inmates in the prison to gamble and they don't have to use money, it could be the loser performs chores for winners or giving up something valuable in the prison. But I expect a lot of cheatings will happen between inmates because most of them are criminals. The dangers of prison gambling is that there are cool headed inmates and aggressive ones, it means that fights can break out. I don't have idea about how they discipline inmates that engages in illegal activities but I reason that it will be severe.