The deal undermines the court and involves “contradictory” diversity requirements, a judge ruled.