When California received $ 410 million as part of a settlement with banks accused of abusive foreclosures, the state used most of the money to offset state deficits. Now an appeals court says the state must return the funds to help homeowners hurt by the foreclosures — like it was supposed to do in the settlement.