It's not so much that they were allowed to petition. The law has various protections in place when the state takes custody and/or terminates parental rights. As with everything in American law, the process begins with a presumption of innocence and guilt must be proven.
Those laws/processes are in place for all our protection. To do otherwise opens the door to administrative abuses, such as have actually occurred across history. There was a time when any single woman giving birth was presumed to be an inadequate parent and lost custody. There have been cases of adoption rings operating through pay-offs to CPS and judges by parents of means wishing to have infants.
Recent article about Georgia Tann and the Tennessee Children's Society, a particularly scandalous operation:
https://nypost.com/2017/06/17/this-woman-stole-children-from-the-poor-to-give-to-the-rich/
This was the subject of a TV movie (Stolen Babies) starring Mary Tyler Moore some years back