Guidance on who is eligible for legal aid in exceptional cases is "unlawful", judges have ruled.
Legal aid was removed from many areas of civil law as part of reforms introduced last year.
The High Court had said the guidelines on who was still eligible were "too restrictive" and overturned refusals of legal aid in six immigration cases.
The government appealed against that decision but Court of Appeal judges have now upheld the original ruling.
The case centres on guidelines about exceptional funding issued by Lord Chancellor Chris Grayling, setting out who is still eligible to apply for legal aid in some cases following the government's reforms.
Ruling on the guidance, Lord Dyson said: "It correctly identifies many of the factors that should be taken into account in deciding whether to grant exceptional funding, but it neutralises their effect by wrongly stating that the threshold for funding is very high and that legal aid is required only in rare and extreme cases."
The Ministry of Justice (MoJ) said it would "carefully consider" its next steps following Monday's ruling.
An MoJ spokesman said: "We continue to believe that the exceptional funding scheme is functioning as intended. Its purpose is to provide funding where it is legally needed.
"Legal aid is a vital part of our justice system but resources are not limitless and must be properly targeted at the cases that need it most.
"The system must be sustainable and fair for those who use it and the taxpayers who pay for it."
by Clive Coleman, BBC legal affairs correspondent
The government's 2013 reforms meant that legal aid was removed from many areas of civil law, including most family, debt, housing and immigration cases.
However, there was to be a safety net of "exceptional funding" available if the denial of legal aid would breach a person's human rights.
Guidance was issued by the Lord Chancellor Chris Grayling, but very few cases qualified for funding.
According to the Ministry of Justice, between 1 April 2013 to 31 March 2014, of 1,520 applications in total only 69 were granted. Monday's ruling was about the lawfulness of the guidance that produced those figures.
The court has now ruled that the guidance was unlawful because it wrongly stated that the threshold for funding was very high - and that legal aid was required only in rare and extreme cases.
It was effectively saying that the Lord Chancellor had been telling the director of Legal Aid Casework and individual caseworkers to apply much too high a threshold for legal aid, within the context of a safety net scheme for some of the most vulnerable members of society. The threshold test will now be eased.
Shadow Justice Minister Andy Slaughter said: "The government's legal aid cuts were rushed through before preparing the necessary evidence to justify them.
"Labour, alongside most of the legal profession, warned that this would raise substantial barriers to access to justice. David Cameron should listen and fix the mess he has created."
The government made wide-ranging changes to how legal aid is provided as part of the Legal Aid, Sentencing and Punishment of Offenders Act 2012, known as Laspo - with section 10 dealing with exceptional funding applications.
It was intended that the flagship legislation would lead to the legal aid bill being reduced by £350 million a year by 2015. Most of the reforms came into force on 1 April 2013.
When Mr Justice Collins ruled on the six refusals of civil legal aid at the High Court in June, he said it was "a fundamental principle that anyone in the UK is subject to its laws and is entitled to their protection".
He indicated that in some of the six cases - which included EU nationals appealing against deportation decisions following criminal convictions and an alleged victim of trafficking from Nigeria - legal aid should have been granted. All should be reconsidered in the light of the ruling, he added.
By the time the government's appeal reached the Court of Appeal, only five of the six cases decided at the High Court remained "live" for consideration. The judges dismissed government challenges in three of the cases and allowed the other two.
Following the Court of Appeal ruling, Bar Council chairman Nicholas Lavender QC said: "We have said since Laspo was introduced that the safety net for providing legal aid in exceptional cases was not fit for purpose."
He added that "the exceptional case funding safety net has failed".