Is there a law or any guidance about bringing a dead body into the house of God? I seem to remember there was something in Leviticus, but I can't find it.
We learn from the Gemoro Pesachim 67 - extract:
Someone who is tamei from a dead body may enter Machaneh Leviyah. Even a Mes (dead body ) itself may be brought there!
The areas in the mishkan and later in the Beis Hamikdosh are described here
Three concentric levels of sanctity existed in the encampment: the innermost area called Machaneh Shechinah, the Divine Camp that contained the mishkan (Tabernacle); Machaneh Leviyah, the encampment of the Levites that surrounded Machaneh Shechinah, and Machaneh Yisrael, an area beyond Machaneh Leviyah where the rest of the Jews encamped. When the Jews settled the Land of Israel these “camps” were represented by the following sanctified areas: the Azarah (Temple Courtyard), which started at Sha’ar Nikanor (the Nikanor Gate) and included the Beit Hamikdash building and the altar (Machaneh Shechinah); Har HaBayit (Machaneh Leviyah) and the rest of Jerusalem (Machaneh Yisrael).
Follow the virtual tour of the Temple Mount here and you will see that there was the Ezrat Nashim - The Women's Courtyard which was part of the temple from which the Sha’ar Nikanor led on to the Azarah, the courtyard.
So we see that a dead body can be taken into the Temple up to Sha’ar Nikanor.
As indicated by the other answers here, no corpses (nor anyone who had recently touched one) were allowed in the Temple.
Today's synagogues are not the Temple in Jerusalem, and many funerals will begin at the synagogue, with the coffin inside the sanctuary, before proceeding to the cemetery. (If they do this, then Kohanim -- those of priestly descent -- will have to remain outside the synagogue while the coffin is in it.)
Numbers 19, God commands that one who is impure from touching a dead body is prohibited from entering the House of God.
13 Whoever touches a corpse, the body of a person who has died, and does not cleanse himself, defiles the Lord’s Tabernacle
This is put into practice in
Numbers 9, where we are told of a group of people who became impure, and were unable to bring the Paschal sacrifice.
Leviticus 16 Aaron is warned
that he is not to come whenever he chooses into the Most Holy Place behind the curtain in front of the atonement cover on the ark, or else he will die.
He is told this after
Leviticus 10, in which Aaron's sons, Nadab and Abihu, brought an improper sacrifice, and died in the House of God.