I've come across several cases of people who were not professional criminals committing crimes so they could get access to medical care, although this is obviously not an issue in the UK.
> 80% of inmates at one Colorado county jail are either mentally ill or have serious medical issues that are diagnosed on arrival
The creation of the mental health system in the UK in the first place was a direct result of the observation that a large percentage of people incarcerated were mentally ill.
The US used to have better mental health care but ended up going in the opposite direction to that of the UK, sadly. These two articles provide a decent overview, although they omit some important legal cases.
The creation of the mental health system in the UK in the first place was a direct result of the observation that a large percentage of people incarcerated were mentally ill.