It gets worse. I think your friend has been very cavalier (putting it mildly) about the manner in which she conceived her child. And, for that matter, with her own safety.
However, what she entered into was not a sperm donor arrangement- whatever the starting point might have been- it was a sexual relationship (which she wanted more from), if not FWB situation. Whatever “form” was on the website was never likely to stand up in court. And I suspect the minute they entered a sexual relationship (which also then extended beyond conception) any scant protection it might (and that’s a very big, speculative might) have had would be null and void. She wants to call it a sperm donation because it suits her now. It was not sperm donation from the point at which she decided to have sexual intercourse with this man.
The most important person here is this child. Who deserves to know both his parents, given the situation. His father wants to be involved and pays maintenance. He cares enough to go to court, force a DNA test and obtain PR. I think that shows a desire to be dad to his child, and that is probably no bad thing for the child. However inconvenient it is for her friend and her new husband.
Whatever you, or your friend, think is immaterial. The court order states he has PR, and so she has to abide by it, or face any consequences that result if she fails to do so. She can’t unilaterally decide the law does not apply to her because she does not like it.
The best you can do is be there to listen. And encourage her to try to put the best interests of their child first, accept that she is going to have to co-parent with their father and make the best of it.