I see prisons a bit differently:
Protect society first and formost.
Punishment
Rehabilitation
You need rehabilitation to prevent the constant cycle of ending up back in prison. If punishment can be done without prison, then it might be more effective for certain crimes.
I also think that drug addicts should not be in prison, drug addicts have an illness, just like alcoholism and if they haven't committed a violent crime they should be in special hospitals to help them with their addiction.
Prison does not contribute anything to the underlining problem, which is their addiction.
Drug dealers should be in prison, in an ideal situation they would be executed, these slugs are useless on every level to any society.
There are also alternatives to prison for young offenders, such as community based programmes, where you could have responsible adults as mentors to young offenders, the mentors could even be retired people in their 60s and 70s, they would build relationships with the young offenders and help them make better decisions about how to lead their lives more positively and be more productive to their community.
The young offenders who have discipline problems should be sent to boot camps, this would help them not only with discipline but also general anger management and also self-esteem.