A federal judge has approved a $601.5 million class action settlement between Countrywide Financial and its shareholders — the largest securities agreement to come out of the housing crisis.