J.D. Flynn explains in First Things:
Catholicism is not a congregationalist religion. Membership is not a self-defining proposition. Grace—the grace of baptism—makes one a Catholic. The Church teaches that “by baptism, one is incorporated into the Church of Christ and is constituted a person in it.” Catholics believe that baptism has certain objective and unalterable consequences. That Catholic identity is not the subject of self-definition. Nor is it the consequence of proper Catholic behavior, or assent to the Church’s teachings, or even obedience to the Magisterium. In 2009, Pope Benedict affirmed that Catholicism comes without an escape clause: Once a person is baptized or received into the Church, there is no getting out. Of course rejecting ecclesiastical communion or the Church’s doctrine has consequences, among them the penalty of excommunication. But excommunication is a punishment, not a shunning. Disobedient or dishonest Catholics might face damnation for their choices, but they will go their deathbeds as members of our Church. One can be a Catholic and be pro-choice, but having rejected the truth and the Church’s communion, he had better be prepared to face his judgment. …The fact is that among the People of God are those who have rejected the grace God has given them. That our Church includes the reprobate, and the dogmatically impure, and that we ourselves sometimes fill out those categories. The unpleasant truth is that one can be Catholic, and still be damned.