How can I improve my standing with the Pope?
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.
Usually, replace him with a friendly pope. Barring that, large sums of money.