In an address to the annual conference of the Catholic Headteachers'
Association of Scotland in Crieff, the Rev Dr Andrew McLellan highlighted the problems of overcrowding and the social ills which had created the backdrop to prisoners' offences.
Dr McLellan called on headteachers to consider inviting prison officers to careers events in schools. "I hope you might think that for children in your school, being a prison officer and dealing with the most damaged as well as the most damaging people would be a good thing to do with their lives," he said.
He urged: "Please show leadership in not blaming jails because they can't heal Scotland. People are often too good at saying: 'It is the fault of the jail.' If anyone should understand this it should be school teachers because they get it too from people who say it is the fault of the schools."
Dr McLellan told heads: "When I was a wee boy at Kilmarnock Academy, there were 4,000 prison places in Scotland and 1,500 prisoners. Today there are 6,000 places and 7,000 prisoners. Barlinnie holds 800 prisoners but tonight there will be between 1,150 and 1,200 crammed into the prison."
The former moderator of the Church of Scotland added: "My job is to be critical of the Scottish Prison Service but the chief executive of the SPS and I agree that the most serious problem facing Scottish prisons is overcrowding - an issue for prisoners and staff."
Education, work and programmes to address offending behaviour were all areas of rehabilitation, but all of these offered challenges.
Most of Scotland's prisoners had extremely low educational attainment, but at least prisons offered them the time to learn and destigmatised literacy and numeracy problems because so many others were in the same position.
Work experience was one of the most valuable experiences - even if it simply taught prisoners the habit of getting up in the morning and going to work.
Courses in learning to think, parenting skills, addiction issues and anger management were all important.
Dr McLellan contrasted the public response to the stabbing of an officer from a police force in England - 600 letters of sympathy and support were sent to the chief constable - and a Barlinnie riot where three prison officers were stabbed by screwdrivers, one within half-an-inch of his heart - not a single letter of support was sent to the prison governor.
At Donald Dewar's funeral, his coffin had been carried by members of the uniformed public services, but prison officers had been overlooked.
Dr McLellan recalled Nelson Mandela's description of his first day in prison: "The test of every country is not how it treats its highest citizens but how it treats its lowest citizens."
He said: "The problems of Scotland's prisons are the problems of Scotland and it is naive to blame prisons when they can't solve the problems of Scotland."
Prisoners had an average age of 26, were overwhelmingly male, the vast majority came from deprived homes and many arrived with illegal substances in their bodies.
There were worrying signs that the number of women offenders was rising more quickly than any other section of the prison population. Half of women prisoners had been convicted of an offence involving violence - a change which Dr McLellan described as "very significant".
When new women prisoners at Cornton Vale were tested for heroin between January and March, 100 per cent tested positive. Across the whole prison estate, the figure was 80 per cent.
Dr McLellan said he was not saying that prisoners were angels. "It is because I want prisoners to stop committing offences and I want Scotland to be safer and there to be fewer victims that I want people to think about prisons and care about prisoners and change things," he said.