Margaret Mitchell, the convener of Holyrood's equal opportunities committee, claimed some men and women were being locked up rather than being given medical treatment. The Tory MSP said about 80 per cent of offenders in Cornton Vale, Scotland's only all-women prison, had mental health problems.
She said that "at least one per cent to two per cent of these prisoners ought to have been hospitalised rather than being sent to prison" while a further eight to ten per cent could be cared for in the community.
Ms Mitchell said: "Put bluntly, if some women and, inevitably, some male offenders are being incarcerated instead of being hospitalised, then in 21st century Scotland we are witnessing scenarios which are more akin to Dickensian Britain."
MSPs scrutinised the impact of the Mental Health (Care and Treatment) (Scotland) Act 2003 - which states every person with a mental health disorder should have a right to advocacy services.
However, Ms Mitchell said that provision of these services was "in effect non-existent for prisoners with mental health problems".
She said: "The Scottish Government must develop approaches to tackle the difficulties groups are facing in accessing these entitlements to advocacy services."
Public health minister Shona Robison said the legislation, which came into effect five years ago, had been a "fundamental attempt to improve the way in which mental health service users are treated in Scotland".