The judge who denied the fee application relied on inappropriate and irrelevant considerations, the appeals court said.