I don't know what to say. Regardless of the validity of their ruling, do they have any idea as to how many families would be on the street if this law were enforced? Families who, in good faith, found a foreclosure, grabbed the opportunity, moved in, settled down, made friends at school and work, and are well on their way to financial success.
Now, suddenly, all their hard work is for naught? All the money they put into these properties fixing them up? Their sweat equity, which they could have worked at a second job, but instead chose to invest in their real property?
I would countersue, saying: Fine: You can have your house back at cost + price below market + every second invested in the house at the highest wage I've ever earned + every penny I've invested in the house including interested calculated at the greatest rate of return I've ever earned in one month since the day I bought the house + all moving expenses + cost of new home of equivalent square footage, location, neighborhood, schools, location to work and if you can't match it, it must be worth more, and you pay the cost.
Here's a better idea: Where THE COURTS goofed in granting foreclosure, THE COURTS should reimburse the plaintiffs for their losses, equivalent to the aforementioned calculations.
Leave the honest, law-abiding families who moved in, in their humble abodes. Put another way, the plaintiffs were wronged. Reimburse them for their troubles, but don't create further wrongs by impacting the innocents. Two wrongs don't make things right.