Children fail to remain in the church because they are poorly catechized.  If parents would only teach them the catechism, so they fully understood the church, they would not only remain catholic, they would realize their very salvation depends upon it.  But once taught the wonders of the institution, no one could ever possibly wish to leave.  They would know how to answer the many attacks made upon the church for perceived errors, like the bishops and vatican's ongoing support fro pedophile priests, the rightfulness of large mansions and elaborate clothing for bishops, and so forth.  Its really only a matter of education.