In this case he already 100% knows that the girl is not his biological daughter rand presented that evidence to the Court... which DID NOT CARE.
The court followed the letter of the law. Men only have two years to challenge paternity in that (and many other states) in many states he has established paternity if he simply says his girlfriend is having his baby.