Avoid Superstition Regarding Sacramentals
Is there a tradition of placing holy cards or sacramentals inside walls of a new building before construction?
Yes. Placing blessed objects (sacramentals) into the walls or foundations of buildings for the protection against evil is a common practice among Catholics. The medal of St. Benedict is frequently used for that purpose, since it’s a prayer of exorcism against Satan (http://www.e-benedictine.com/medal/).
However, blessed objects must always be treated with reverence and respect and never as a charm or object of superstition. The Baltimore Catechism warns against using sacramentals in a way that is prohibited by the Church:
Persons may sin in using sacramentals by using them in a way or for a purpose prohibited by the Church; also by believing that the use of sacramentals will save us in spite of our sinful lives. We must remember that sacramentals can aid us only through the blessing the Church gives them and through the good dispositions they excite in us. They have, therefore, no power in themselves, and to put too much confidence in their use leads to superstition (lesson 27, Q. 1060).
Further reading on sacramentals.