There are a few problems with legal aid, the biggest being that it creates a vast legal underclass, those who do not qualify for aid but at the same time do not have the resources to go to law.
Unlike the no win no fee ambulance chasers legal aid does in fact claw back costs from any awards made, so it is not just you and I funding Johnny or Jeanie to line their own pockets.
Rather than cap legal aid which would effectively remove recourse to the law for even more of our society, it would be far better to find ways in which the legal process can be streamlined to cut costs, this would equally benefit the very large numbers who currently get no legal aid and thus have little recourse to the law to solve problems.
As it stands legal aid does depend on a risk assesment, but it is also tempered with the whether the case is important, so yes they will fund some one to fail, because from the point of the public good the failure can be important. I would put the legality of school dress codes in that bracket.