As others have stated above, this isn't really about protecting "family harmony" / "saving the child", it’s about cost.
If paternity tests were easily accessible, many men would easily contest child support and if successful, they would opt out. The state benefits from keeping paternity disputes out of court because it ensures that private individuals, rather than government welfare programs, remain responsible for child support.
If too many men successfully challenged paternity, the state would be forced to provide financial aid for more children, increasing costs. Restricting paternity tests shifts the burden away from taxpayers and onto unwitting fathers, all while claiming it’s about social stability.
I wonder how would you react if you received a notification that half your paycheck will be henceforth withheld to support some random kid.
this comparison is not entirely fair, because in this scenario, the kid's mother did not deliver a grievous, unforgivable insult to you - which is the case with those poor souls who got scammed into paying child support for some whore's bastard whelp.
the state doesn't give a flying fuck about the child's 'financial distress'. the state simply doesn't want to support it.