Mentally, there was a strict separation of the Pope as spiritual head of the church and Pope as temporal prince of the papal states.
They were rarely confused. Few popes dared invoke their spiritual status in temporal battles, as he would essentially be opening the door for the invading king to hold his own council of bishops and depose him as spiritual head (and vice-versa - you can rape the pope's lands, but if you "question" his spiritual status, you're opening yourself up to religious blowback.)
So long as the war remained strictly about land, it was fine.
Catholics felt more scandalized about attacks on religious places (e.g. monasteries) than the temporal lands of the pope. Papal-owned land is not itself sacred.
I'm seconding this, when the Pope ran a nation, the world understood without anyone having to say that the Pope as 'king' of the Papal States and the Pope as Pope of the Church were wholly different things despite being the same person.
Like how David Tennant Marrying Doctor Who's daughter is ok, because people today understand that while David Tennant and the 10th Doctor are the same person, they're separate entities.
it's only now that the pope doesn't run a country that it get's confusing.
Like when V2 came out, alot of people complained that the Papal States could reform as they couldn't grasp that the Papal States with the Pope as HoS could have a parliamentary democracy without that also meaning that the Church would have the parliamentary democracy of a central italian state running it.
But in the era when it was a thing, everyone just understood the state was not the Church and the Church was not the State it so there was no problem, unless you were doing a Spain or Napoleon and warring not against the Pope of the Papal States, but against the Pope of the Catholic Church.
Infallibility is another matter altogether, and while it existed in theory for centuries was only scripted and formalized after a long and contentious debate during Vatican I, and was brought about SPECIFICALLY by the most conservative elements of the Roman Church to refute the concepts of evolution as forwarded by Darwinism.
Um, no. Infallibility was brought in by the Italian elements of the Church, to refute the idea of devolution to the French. Which is why it happened when the war with Italy cut the French bishops from getting to the council so the Italians pushed it through so the Pope could over-rule past councils and popular consensus to beat the French.
it has nothing to do with Darwinism, the Catholics didn't care about Darwinism until it became political and racist which was long after V1. The Church was one of the first organisations to officially endorse the theory of evolution.
Infallibility was entirely about infighting within the catholic hierarchy between Ultramontanism and Conciliarism, i.e. centralisation v decentralisation.
Just because your tin foil hat shines pretty in the sunlight, doesn't mean you have to wear it.