The commentary I’m reading on the book of Hebrews had this thoughtful aside on why a church could be called “holy”:
…the church is holy, which is, of course, a tricky concept. The Preacher certainly knows that everyone who has spent more than a day around church people inevitably knows: the trees in the church’s moral forest do not grow any higher than anywhere else. If greed infects the world, it poisons the church, too. If bigotry walks through society, it slithers its way along Church Street as well. The same goes for lust, pride, anger, sloth, and all the other deadly sins; the church is immune to none of them. Nevertheless, the Preacher dares to call the church holy because he knows that holiness is not an intrinsic human virtue but a divine gift. A scalpel is nothing but a knife until it is used by the surgeon for healing; a church is nothing but a collection of sinful people until it is gathered by the grace of God into seasons of worship and acts of love.
The church is holy not because of the purity of its membership but rather because it is made holy by Jesus. Jesus, through his own sufferings, knows every crevice of human weakness, and the living Christ is at work in the church, strengthening the community of faith beyond their own capacities for a ministry of mercy, service, and worship. In this sense, holiness is not so much a description of the church’s moral stature as it is a sign of how gracefully God puts the church to work in the world. The church is holy like the bread at the Lord’s Table is holy; though quite ordinary, it is nonetheless set apart for holy use and becomes the instrument of the extraordinary purposes of God.
Link to this page (on google books): https://books.google.com/books?id=payF5gRJRUoC&pg=PA47&lpg=PA47&dq