There's a system in place where you can trade rehabilitation points for whatever items you want — some cost practically nothing while others are more expensive or even completely restricted.
Good behavior is rewarded while breaking the facility rules is punished. It's a fairly straight-forward system.