So the Devil could get into the holy of holies and gain more influence over people. From the sacristan's story to the children we know that he had already tried to get into the church from the cellar, but was driven out with the help of holy water. After that, the Devil seems to have gotten smarter. He tempted Carlo - roughly speaking, got a pass through the originally innocent soul.