A couple of three things spring to mind...

First of all, the message you mentioned was "the enemy general has been captured", not "the enemy King has been captured", which suggests the army was led by someone other than Popey himself. Did you happen to see the movement of the army piece on the strategic map just prior to the battle? Was it the big one with the faction leader?
I've read a comment elsewhere mentioning a situation where the faction leader's unit was seen to withdraw from the battle map (orderly retreat, as opposed to a rout). The rest of its army benefited from the valour bonus of the general and continued to fight. Those who like to target the enemy general's unit to trigger a mass rout would find this very frustrating. Chances are that the AI Pope is capable of pulling this stunt.

Second, enemy Kings will do one of two things in a battle once the knights in their unit have been killed or routed: - run like the proverbial whipped dog or fight to the death. The more command stars and the higher their unit valour, the more likely it is to be the latter option.

I've only had MTW for a short while and I'm surprised to find some of my Royal Princes have the 'captured' V&V right from the moment they come of age. Absurd as this sounds, it gives them a massive valour boost (just them personally, not the whole RKts unit) so, if mobbed from all sides, they will fight to the death rather than allow themselves to be captured. You may see this particular V&V in enemy generals and Kings and, luckily for me, it has only been AI kings who've bought the farm where I've been involved in a battle....

Thirdly, the Papacy is not a line of inheritance. Like the HRE Emperors, if you do succeed in killing one of them, a new one is elected in their place. Maybe that's what happened.

Excommunications will come to an end, provided the Pape dies of natural causes... or your King predeceases him.

Then again, even given my minimal experience of the game, I've already had one excom which was continued even after the death of one pope because he died in the very same year as I made an attack. This was ironic because I'd planned the move partly on account of the Pope being in his 70's and it was going to be the last chance for a long while, so the timing was really unfortunate. Even the total withdrawal of my force in the following year did nothing for me. The territory was notionally 'mine' that year, the besieged force took it back without a fight but the 'hostilities' were then in an ongoing state. I either neglected to request a ceasefire or just ran out of time in tracking down the enemy leader or his emissaries. It pays to keep your Ems following them from place to place....

Now what I find really galling is where one of the AI factions attacks me first (usually one of my ships, starting a blockade which puts me in negative equity), then the combinations of alliances with the aggressor country means all my supposedly-trusted allies decide to cancel their treaties with ME, rather than them and then, to top it all, the Pope excommunicates my faction, even though we didn't start it.

HTH