Margaret Ritchie withdrew funding following an ultimatum to the UDA
The taxpayer will have to meet costs of around £300,000 incurred in the High Court case against Social Development Minister Margaret Ritchie.
A High Court judge ruled Ms Ritchie was wrong to cut funding for a loyalist conflict transformation initiative as she had not followed proper procedure.
Ms Ritchie withdrew £1m of public money after UDA-led violence in Carrickfergus and Bangor in 2007.
A statement released by her department said she stood by her decision.
"The arguments against her, ie that she failed to consult, that her mind was made up, or that she had no right to take the decision, were thrown out by the court," it said.
"The judge in effect ruled that the problem was an 'error in procedure'.
"The minister maintains she was right to stop funding the UDA linked project at that time and would take the same decision again."
Mr Justice Morgan ruled she had not followed proper procedure and quashed her decision to cut the funding.
The minister cut funding for the Conflict Transformation Initiative (CTI) in October 2007, when the UDA failed to meet her 60-day ultimatum to end criminality and begin decommissioning its weapons following the violence.
A member of staff at Farset, an independent body appointed to oversee the CTI project set up under direct rule, sought a judicial review of her decision.
Mr Justice Morgan said Ms Ritchie had breached the ministerial code, which required all ministers to support and to act in accordance with all decisions of the executive and assembly.
The code requires ministers to bring any significant or controversial matters to the attention of the executive.
In his ruling, the judge said the minister had received legal advice on her decision to withdraw funding, but had not forwarded it to the first minister and deputy first minister or finance minister in sufficient time.
Ms Ritchie was required to defer her decision until the minister for finance had considered the legal advice.
She had not done so and was thereby in breach of the Ministerial Code, said the judge.
He said: "Although I recognise the urgency which the minister attached to clarification of this issue, I considered that by proceeding with the announcement on 16 October 2007 she voluntarily accepted the risk that she was not acting in accordance with the ministerial code."
Gerald Solinas took the case against the minister
The judge concluded that the minister acted unlawfully by breaching the code.
First Minister Peter Robinson, who was finance minister at the time Ms Ritchie made her decision, said there was "an air of inevitability" about the judge's ruling.
"The law was very clear. I warned Margaret she was in breach of the ministerial code, the head of the civil service warned she was in breach of the ministerial code, and she went ahead," he said.
"The people of Northern Ireland are now paying the consequences. How many houses could have been repaired or improved with the money that has been wasted in defending this case?"
The judge added that the applicant in the case was directly affected by the minister's decision, and at risk of losing his job.
He concluded that such a breach should result in a practical and effective remedy, and he made the order quashing the ministerial decision to cease funding.
Gerald Solinas, the member of staff at Farset who took the case, said it was a "very stressful time" for the organisation.
"Playing games with people in hard to reach loyalist communities, with their social needs, isn't really the best," he said.
Mr Solinas said the decision would bring more certainty to the group and the communities it helps.
"People didn't know if we were going to be there from day to day, but we've been continuing to change things in loyalist communities for the better.
"It will bring more confidence to loyalist communities, and that's the whole idea of the Conflict Transformation Initiative."