When the Court of Appeal heard this claim, Gloster LJ began her judgment with what Lord Toulson in the Supreme Court called a “cri de coeur”.
“As any hapless law student attempting to grapple with the concept of illegality knows, it is almost impossible to ascertain or articulate principled rules from the authorities relating to the recovery of money or other assets paid or transferred under illegal contracts.”
And not only law students. The cases on illegality as a defence are bewildering.
The doctrine of illegality – Tinsley v Milligan
The doctrine of illegality, going back to Lord Mansfield, is based on 2 principles; first that a person should not benefit from his/her own wrong; and second, that the law should not condone illegality. In Tinsley v Milligan  1 AC 340, Ms Tinsley and Ms Milligan bought a house together but the property was put in the former’s name to allow the latter to claim state benefits. Ms Milligan then confessed and was given notice to quit – she counterclaimed for a declaration that the property was held by Miss Tinsley on trust for the parties in equal shares. The House of Lords, by 3:2, held that the test was whether Ms Milligan had to rely upon her own illegality to prove her claim. Given that title to property could pass even under an illegal transaction, all Ms Milligan had to do was to show that she had made contributions to the purchase price. Lord Browne-Wilkinson said that the question was not substantive but procedural (@ 374)
The question therefore is, ‘In what circumstances will equity refuse to enforce equitable rights which undoubtedly exist.’?
The minority held that a court should not enforce a claim to property based upon illegality. The Law Commission examined the topic after Tinsley v Milligan and concluded that in cases of restitution, there appeared to be little scope for the doctrine of illegality but that the courts were strict in applying the doctrine of ex turpi causa save in limited exceptions, such as duress, ignorance and locus poenitentiae, namely withdrawing from the transaction.
Restatement of principles – Patel v Mirza
In Patel v Mirza,  UKSC 42, 9 Supreme Court judges reviewed and restated the applicable principles. The majority was of the view that in future, the deployment of illegality as a defence should be dependent upon a range of factors, based upon the purpose behind the public policy violated. All 9 agreed that the money should be returned. Tinsley v Milligan was no longer good law.
Mr Patel transferred a total of £620,000 to Mr Mirza for the purpose of betting on the price of RBS shares. The plan – contrary to s.52 of the Criminal Justice Act 1993- involved using advance insider information which Mr Mirza expected to obtain from RBS contacts regarding an anticipated Government announcement. This would affect the share price. The announcement never materialised, contrary to Mr Mirza’s expectation, and so the bet never happened, but Mr Mirza did not return Mr Patel’s money and he issued proceedings to recover it. Mr Mirza argued that in view of the illegality, Mr Patel could not succeed. Mr Patel argued that were Mr Mirza to retain his money, it would be a breach of contract and/or unjust enrichment.
At first instance, Mr Patel’s claim was rejected because he had to rely upon his own illegality to establish it. Nor could he rely on locus poenitentiae because he had not withdrawn from the arrangement. The Court of Appeal upheld Mr Patel’s appeal but differed in its reasoning. The majority held that the reliance principle in Tinsley v Milligan, whilst correct in law, did not apply because the scheme had never been executed. Gloster LJ, however, doubted whether Tinsley v Milligan was of universal application. Rather, she held that the Court should examine the public policy behind the rule rendering the contract illegal and ask whether it would be “stultified” in allowing the claim. In this case, she said that the policy against insider trading, namely rigging the market, was not “stultified” because the scheme did not succeed as it had not been put into place.
The Majority Judgments: purpose, policy and proportionality
Giving the leading judgment in the Supreme Court, Lord Toulson (with whom Lady Hale and Lords Kerr, Hodge and Wilson agreed) reviewed the authorities before and after Tinsley v Milligan, the Law Commission and the views of leading academic commentators. He agreed with the approach taken by Gloster LJ in the Court of Appeal. He said @ paragraph 101:
It is not a matter which can be determined mechanistically. So how is the court to determine the matter if not by some mechanistic process? In answer to that question, I would say that one cannot judge whether allowing a claim which is in some way tainted by illegality would be contrary to the public interest, because it would be harmful to the integrity of the legal system, without a) considering the underlying purpose of the prohibition which has been transgressed, b) considering conversely any other relevant public policies which may be rendered ineffective or less effective by denial of the claim, and c) keeping in mind the possibility of overkill unless the law is applied with a due sense of proportionality.
It was, he said, necessary to balance the conflicting public interests that may arise from the facts of a particular case, citing the example of Hounga v Allen  1 WLR 2889, where the Claimant was awarded damages for injury to feelings for discrimination, despite being employed under an illegal contract. He then said (@ paragraph 113):
Critics of the “range of factors” approach say that it would create unacceptable uncertainty. I would make three points in reply. First, one of the principal criticisms of the law has been its uncertainty and unpredictability. Doctrinally it is riven with uncertainties: see, for example, paras 4-8 above. There is also uncertainty how a court will in practice steer its way in order to reach what appears to be a just and reasonable result. Second, I am not aware of evidence that uncertainty has been a source of serious problems in those jurisdictions which have taken a relatively flexible approach. Third, there are areas in which certainty is particularly important. Ordinary citizens and businesses enter into all sorts of everyday lawful activities which are governed by well understood rules of law..….The same considerations do not apply in the same way to people contemplating unlawful activity.
Lord Neuberger, in a concurring judgment, accepted Lord Toulson’s approach; it was, he said, “as reliable and helpful guidance as is possible to give in this difficult field”. In general, he held that the Rule should be that the claimant should be entitled to the return of his money where money is paid pursuant to a contract to carry out an illegal activity where the contract is not in fact carried out in circumstances beyond the control of either party. He defined illegality as a contract which was (i) for the commission of a crime (ii) necessarily involved the commission of a crime or (iii) because the contract could not be performed without the commission of a crime (@ paragraph 159). He rejected the idea that there should be a distinction between common law claims and claims in equity as not “appropriate”. The Rule was justified first by precedent set by Lord Mansfield in Smith v Bromley  2 Doug KB 696 and Walter v Chapman  Lofft 342 and Lord Thurlow in Neville v Wilkinson and Mellish LJ in Taylor v Bowers  1QBD 291 and more recently by the Court of Appeal in Tribe v Tribe  1 Ch. 107. The Rule was also justified by policy, as explained in the Canadian Supreme Court by McLachlin J in Hall v Hebert  2 SCR 159, namely that the power to refuse relief to a claimant “is justified where allowing the plaintiff’s claim would introduce inconsistency into the fabric of the law, either by permitting the plaintiff to profit from an illegal or wrongful act, or to evade a penalty prescribed by criminal law”.
The Minority Judgments
Lord Sumption (with whom Lord Clarke agreed) took a different view. In his view, the range of factors test was “far too vague and potentially far too wide to serve as the basis on which a person may be denied his legal rights”. The result would be unpredictable and dependent upon the judge’s reaction; to impose it would just replace a mess with a new mess (@ paragraph 265). The contract was clearly an illegal one in that it involved insider trading, which was contrary to s.52 of the Criminal Justice Act 1993. However, given that the contract had not been implemented, restitution was still possible. It would not give effect to a legal act or any result from it, but would simply restore the parties to the position they had been in previously.
Lord Mance, though in agreement with Lord Sumption and Lord Clarke, thought it necessary to emphasise that the doctrine of locus poenitentiae should be considered. In effect, his view was that rescission should again play an important part in the Law and should not be limited by questions of illegality or part performance.
The logic of the principle is that the illegal transaction should be disregarded, and the parties restored to the position in which they would have been, had they never entered into it. If and to the extent that the rescission on that basis remains possible, then prima facie it should be available. (@ paragraph 197)
The decision will affect property, tort, contract and unjust enrichment claims and will require litigants to be carefully advised on the three planks of the approach: the purpose of the prohibition breached, the public policy engaged, and what the proportionate response of the court should be in the case before it