Psychiatry is as beautiful as it is fascinating. A lot of persons you see exhibiting 'bad' behaviours are not bad people - just mentally unwell. For instance, a sufferer of Bipolar Affective Disorder during a manic phase can do a lot of irrational things - become sexually promiscuous, engage in a lot of risky behaviours and even do many embarrassing or outrightly unlawful things that can land them in jail.
Many persons locked up in prisons are mentally unwell persons who haven't yet been diagnosed as at the time of the 'crime'. With the stigma surrounding mental health problems, many will rather go to jail that accept that they are ill.
Bad people do exist. Criminals, who intentionally set out to hurt other persons. These ones, rightly belong to prison. The irony is that some of these persons are the ones that might play the 'mental health' card to escape the consequences of their crimes.
The big question is: where do you draw the line between bad behaviour and mental illness? This is one of the many questions Psychiatrists can help to answer.
In some cases, this answer can be the difference between getting mental health help or dying in prison.