The Priest was an idiot
No wonder the church wanted rid of him
At the end he tells the demon to take him instead Sonny so that Sonny won't feel the pain any more but now Sonny is going to spend the rest of his life in prison living with memories of what he did while the demon that the priest wanted to stop is free to keep on killing people on the outside and the priest will be unable to stop him, not only that the church won't believe him even if he could warn them because they already think he is insane
Literally every decision the priest makes at the end is a bad one