It seems to me that a simple DNA test of the child and both of the women would answer the question quite simply. The DNA of the child and the birth mother would be close, while that of the non-birth mother not be, with maybe a few random markers being similar due to general ethnicity factors. End of “biological” discussion. And, since she never signed on as an “adoptive” parent, it’s “too bad, so sad” for her!
The only complication I can see is if the “anonymous” sperm donor was a close relative (brother, father, like that) of the woman who didn’t bear the child. Such a happenstance would place the non-birth mother’s DNA closer, given the familial closeness.
We all know, of course, who will be the winners in this case: each of the women’s lawyers. Everyone else involved are clear losers, mentally and/or financially.
It would seem that anonymous sperm donations makes it impossible to learn if there is a family history of inheritable diseases.