Claims that money diverted from the prison service could have helped end "slopping out" in Scotland's jails have been dismissed by ministers.
There have been frequent calls for the practice to end
Opposition parties have seized on a judgement that the practice infringes on prisoners' human rights.
In 1999, £13m was switched from the budget of the Scottish Prison Service.
But First Minister Jack McConnell and his deputy, Jim Wallace, insisted the move to fund projects like the Scottish Drug Enforcement Agency was right.
This decision was cited by a senior judge as evidence that ministers could have ended the practice of slopping out at Glasgow's Barlinnie prison C Hall much earlier.
Lord Bonomy ruled on Monday that slopping out at the Glasgow jail contravened
the human rights of prisoner Robert Napier and awarded him damages of £2,450.
The landmark ruling could open the floodgates for other damages claims totalling millions of pounds from other prisoners.
About 1,200 prisoners in Scotland are still slopping out.
Mr Wallace was justice minister at the time when the money was taken from the
Scottish Prison Service's budget.
And Mr McConnell said: "There is a problem in Scottish prisons with the issue of slopping out.
"But it's a problem that could have been dealt with in the early 1990s when the Tory government were allocating resources to end slopping out in England and Wales but not Scotland.
"And they have left us to pick up that challenge. There should be no doubt as to the determination of this partnership government to end slopping out, and to do so as the resources that we have allow us to."
Mr Wallace said ministers had been right to invest money in the drugs agency in 1999.
"There was no part of that £13m that had been earmarked for any specific project with regard to slopping out," said Mr Wallace.
He insisted the first Holyrood administration had "grasped the nettle" of prison building modernisation and £1m a week was being invested.
But Scottish National Party justice spokeswoman Nicola Sturgeon slammed the funding switch.
"That public money, instead of being invested in improving prison conditions might actually now have to be paid out in compensation to convicted prisoners," she said.
"It's just crazy and it is, I think, the result of executive inaction."