The Papal States were a series of territories in the Italian Peninsula under the direct sovereign rule of the Pope, from the 8th century until 1870. At their zenith, the Papal States covered most of Central Italy and some parts of France. These holdings were considered to be a manifestation of the temporal power of the pope, as opposed to his ecclesiastical primacy.
Historically the Papal States maintained military forces composed of volunteers and mercenaries. However, the rise of nationalism around the world began to erode the church's authority over its holdings. The papal states came to an end with the unification of Italy, which at the time was led by a staunch, anti-catholic. Today its authority extends only to the Vatican City in Rome. For this world I want the papal states to survive up to modern times, and have incorporated some changes throughout history to make the states more secure.
The Pope has generally had a contentious hold over these territories. The church's army was generally made up of volunteers and mercenaries, giving him a fairly weak grasp on power there. Papal states were often contested between the church and various emperors, and it was until the 16th century that the Pope had secured authority. The various regional components retained their identity under papal rule. The pope was represented in each province by a governor. Other titles like Papal Vicar, Vicar General, and several noble titles like "count" or even "prince" were used. However, throughout the Papal States' history many warlords and even bandit chieftains ruled cities and small duchies with no title bestowed by the Pope.
In this setting, I want the church to keep a significant standing army in all of its territories to secure them from invasion or internal rebellion. I also want local rulers to be church officials elected by the Pope directly, or some governing body of the church. This would give it more control over its holdings. In this sense, the states would become something resembling a theocracy, with the Pope at the head and various leaders connected to the church ruling in his stead. What would be the best way for him to go about this?