The Mystery of Israel and the Church, Vol. 1: Figure and Fulfillment:
"Here in the Church Militant on Earth, the law of God teaches us to overcome the root of discord, which lies in human vice and injustice. Furthermore, this law is not simply engraved on tablets of stone, but etched on the human heart through sanctifying grace and the gifts of the Holy Spirit, as prophesied by Jeremiah and Ezekiel. This comes to us through the seven sacraments of the New Law of Christ.
However, the sacraments do not function in a mechanical way, disregarding human freedom. They require our good dispositions and our cooperation. The sacraments, the Gospel, and the teaching authority of the Church make possible the attainment of sanctity for all who sincerely seek it. However, grace may be resisted by the hardness of the human heart. Thus in the bosom of the Church countless scandals occur. The Church Militant will always be in conflict with "the world," both outside of her and within the lives of her members and in so-called Christian societies.
The Church is truly holy, as we profess in the Creed, and she is the recipient of the peace of the Lord which passes all understanding. Yet the sanctity of the Church does not exclude the presence of sin and sinners in her midst. For members of the Church do not always live in accord with the sanctity of Christ and the grace of the Holy Spirit by which the Church is animated. In the Church, there are living members, who are in a state of sanctifying grace, and dead members, who are in a state of mortal sin, despite their baptism and their outward profession of the Catholic faith. The sanctity of the Church and the beatitude of the peacemakers are manifested only by the living members, and especially by those who not only live in a state of grace, but who excel in holiness. Such holy members have never been lacking in the history of the Church, as can be seen in the beatification and canonization of the saints."
Or, more simply, the Church is the body of Christ with Christ as the head. Christ and His body remain holy despite sin being present in the Church.