You don't go to court unless you are willing to submit to a decision against you, and the Church cannot subject herself to any temporal court. Least of all to the court system that holds abortion legal, and, increasingly, gay "marriage" legal.
Let the government sue the Church then. An adverse ruling would at least serve to demonstrate that even courts are no longer willing to uphold the First Amendment right to free exercise of religion. Then they could pull out of the adoption business under protest. It’s better to stand up for the rights of the Church first rather than simply surrenduring and withdrawing from the field in the first instance, as the Church in Massachusetts has done. Of course there’s the additional problem that some of the Catholic Charities people and perhaps even archdiocesan people were not on board with the Church’s teaching, but that’s a separate issue.