45 It also belongs to the State to protect the rights of the child itself when the parents are found wanting either physically or morally in this respect, whether by default, incapacity or misconduct, since, as has been shown, their right to educate is not an absolute and despotic one, but dependent on the natural and divine law, and therefore subject alike to the authority and jurisdiction of the Church, and to the vigilance and administrative care of the State in view of the common good. Besides, the family is not a perfect society, that is, it has not in itself all the means necessary for its full development. In such cases, exceptional no doubt, the State does not put itself in the place of the family, but merely supplies deficiencies, and provides suitable means, always in conformity with the natural rights of the child and the supernatural rights of the Church.
Source: Divini Illius Magistri (Vatican.va)