Churches are dedicated (blessed) by the bishop.
Can. 1212 Sacred places lose their dedication or blessing if they have been destroyed in large part, or have been turned over permanently to profane use by decree of the competent ordinary or in fact.
http://www.vatican.va/archive/ENG1104/_P4G.HTM#8RThe dedication has nothing to do with the debt. In the traditional times many masses were celebrated in un-dedicated places, usually in schools, also many times masses were celebrated in open places, which could accommodate more crowd than a building.
Are all Catholic churches consecrated or must the parish be debt-free before a church (the building itself) can be consecrated? And, if a church is consecrated and it is then used for a Jewish service, or even a Protestant service, is the church then desecrated? If a church is not consecrated does using it for services other than Catholic ones make it unsuitable for future consecration?
Any info about the consecration or desecration of a church, not related to the building deteriorating, would be welcome. I am trying to locate a passage I found several months ago, which I thought was on the Vatican's website, and which I cannot locate now. Thanks in advance to anyone who can shed more light on this subject.