In his catechesis for the general audience of 2013/10/02, Pope Francis had this to say:
The Church is holy because “she comes from God Who is holy, Who is faithful to her and never abandons her to the power of death and evil. She is holy because Jesus Christ, Saint of God, is indissolubly united to her; she is holy because she is guided by the Holy Spirit which purifies, transforms, and renews. She is not holy by our merits, but because God makes her holy”.
Everything comes from God and is holy to a significant extent. The Church is holy by intent, `intent’ being used in the Thomistic sense of a purposeful, goal-oriented, growth process. An acorn intends to the state of `oak tree’ and a man may intend to the state of sainthood. This is to say that the Church is holy because She intends to (purposefully grows toward) the state of being the central organ, the organ of worship and of moral conscience, of the complete and perfected Body of Christ in the world of the resurrected. Clearly, this sort of growth process is consistent with various developmental problems, even cancerous growths within the Church. This sort of growth process can also chew up many of the individual `cells’ of the communal organism at one time or another. We might well be able to understand the problems of the Church over the years simply by remembering our own growth problems and diseases. At times the Church can be infected by horrible diseases, as is truth of any other living, growing entity, even one growing toward such a glorious state.