Judge approves deal despite sharp public misgivings