Clean hands is a requirement for a court to choose to apply an equitable remedy - equitable remedies are always at the discretion of the court.
From the example above, Bob does not have clean hands so cannot be granted an equitable remedy such as, the very applicable unjust enrichment. At the same time, the contract is void ab initio as it is for an illegal ...
As the money is the fruit of a crime, it can be sized by the government, and neither Bob nor Rob will retain it.
Stolen property is usually returned to the legal owner, when the owner can be identified, but other fruits of crime, such as the proceeds of unlawful drug sales, are often subject to seizure by the government. See "civil forfeiture".
The maxim is codified in statute, and therefore it binds courts in providing legal remedy as though they provided it in equity; Bob could not obtain legal remedy either.
Cal. Civ. Code § 3317
No one can take advantage of his own wrong.