While it seems like a logical idea, I'm not sure how it could actually be enforced.
From Inside Edition:
A family court judge ordered a mother not to get pregnant again after she lost custody of her fourth child. According to court documents, the defendant had the child in July but the baby boy was born prematurely and addicted to drugs. They also stated she had three other children also born addicted to drugs. Judge Patricia Gallagher wrote the decision back in December. Some legal experts question whether the judge can make such a ruling or how it could even be enforced.