In Medieval 2 Total War, your standing with the Pope / Papacy is an extremely important factor. What choices impact your standing with the pope? Does the number of churches and priests I have even matter?
According to this GameFaqs strategy guide, the following works for maintaining a good relationship with the Pope:
"Doing missions for the Pope, not fighting other Catholics, and giving the Pope large sums of money are good ways to maintain a healthy relationship with him."
The strategy guide also mentions assassinating the Pope to try to get someone more favorable to you to be the Pope and bribery for when you get excommunicated.