Bishop Mastai Ferretti
After apparently being miraculously cured of epilepsy, the future Pope Pius IX became a priest in 1819. In 1823 Pius VII sent him on a diplomatic mission to Chile. By the time Father Mastai returned, Pius had died. His successor, Pope Leo XII, appointed Mastai Archbishop of Spoleto, a troubled diocese in the papal state of Umbria, in 1827.
Although the Congress of Vienna had ceded temporal power over the Papal States back to the pope, that authority was quickly attacked. This was only logical. The Papal States were living proof that the Church could, and perhaps should, govern in the temporal realm. Such retrograde notions gave progressives and other forward thinking folks hives. 
Even worse, the architect of the Vienna Restoration, the Austrian Empire’s political master Prince Klemens von Metternich, threw down the gauntlet when he urged the reconstituted European monarchies to “suppress Secret Societies, that gangrene of society.” The battle lines were drawn. Consequently, a leading authority on 19th century Italy like Denis Mack Smith is noted: “Very soon after the Restoration of 1814-15, secret societies became active with the avowed policy of overthrowing the Vienna settlement.” 
The societies were nowhere more active than in the Papal States, including Archbishop Mastai’s diocese of Spoleto. Chief among them was the Carbonari, an Italianized version of the French Freemasonry imported by Napoleon:
“This secret society of the ‘charcoal burners’ had an interesting ideology, partly derived from French Freemasonry, partly from more obscure Italian sources. Their motto was 'despotism annihilated' - an achievement symbolized on a medal by the Goddess of Liberty slaying the Dragon of Tyranny. The authority most particularly sought out for slaying was that of the Church, though this was not disclosed, explicitly, to any but those few who attained to the Seventh Grade of initiation.”
 It was the Carbonari who organized a revolt against papal rule in 1830-31. The violence in the Papal States spilled over into Rome itself, and the new Pope, Gregory XVI, was forced to use Austrian troops to end the violence. When a Carbonari force came to Spoleto, Mastai met with the revolutionaries and, through a combination of verbal persuasion and money, induced them to disarm and disband. Later one of the Carbonari, Prince Louis Napoleon (nephew of Bonaparte), privately requested assistance leaving the country. Mastai gave the future Napoleon III (and his mother) passports to Switzerland. When Austrian secret police sought Mastai’s assistance in ferreting out Prince Louis and the rest of Spoleto’s radical underground, the Archbishop coldly refused to cooperate.
 It has occasionally been asserted that before becoming Pius IX, Mastai was a Freemason, or at least a liberal sympathetic to the ideals of Masonry. It should be remembered however, that many Italians resented Austrian presence. Perhaps Mastai's coldness towards the Austrians was due to nationalism.
It should also be remembered that it is very difficult to prove membership in a secret society. Freemasons who allege Mastai was a Mason can hardly be considered an objective source. Another allegation, that Mastai was enrolled in a lodge in Philadelphia, Pennsylvania, is simply ridiculous.
Last, it is instructive to reflect upon the character of Bishop Mastai/Pius IX. Had he, when younger, been involved in Masonry to any extent, he would surely have publicly disavowed this. Moreover, his formation, his purity, his piety, his zeal, and his devotion to the Blessed Virgin makes an affinity for Masonry stand in jarring contrast to his Catholicity.
Papal states
 Consequently, it is at least reasonable to conclude that Bishop Mastai's dealings with the Carbonari were motivated by the desire to prevent bloodshed in his diocese, and his coldness to the Austrians was probably due more to his Italian nationalism than his fidelity to a secret society. Mastai was as patriotic as any of his countrymen, most of whom never dreamed of separating Church and State. The extent of Mastai’s radical politics was his interest in the question of Italian unification, which at the time was seen as a remedy to foreign (read: Austrian) involvement in Italian affairs. This merely makes him an informed man of his times, however; to imply more risks overstatement. 
The charge of liberalism seems more plausible, on the surface at least. Mastai’s parents had a vague reputation for being “enlightened,” which in Catholic circles was not a compliment. Pope Gregory’s Secretary of State, Lambruschini, complained that “Everyone in the Mastai family is a liberal, even the cats!” 
Details were not forthcoming, however, and Mastai was never accused of being a follower of, say, the liberal priest Lammenais, who was condemned in 1832 by Gregory XVI shortly after the incident in Spoleto, and shortly before Gregory appointed Mastai Bishop of Imola (1833). It is reasonable to assume Gregory was sufficiently satisfied with Mastai’s orthodoxy to put him in a see that invariably produced cardinals. It is also reasonable to assume that the nine years Mastai had to wait for the cardinal’s hat was Gregory’s way of making sure he had the right man for the job.
A sensible explanation of Mastai’s liberalism comes from Professor and Church historian Henri Daniel-Rops:
“His so-called liberalism was nothing more than a true liberality of soul and the clear conviction that the methods employed hitherto against the new ideas were wrong. He judged it absurd to oppose railways, gaslight, suspension bridges and scientific congresses – all novelties that could do the Church no harm. He considered that the papal administration needed a thorough overhaul. Lastly, he believed that the best way for a ruler to halt the advance of revolution was not to have recourse to high-handed measures, but to set himself to win men’s hearts by gentleness, generosity and confidence.”
Nearly two centuries later a delicate investigation into a prelate or pope's liberalism may seem quaint. After all, the Second Vatican Council opened the Church's windows to the world and legitimized at the highest levels the Liberty, Equality, and Fraternity of the French Revolution, as well as subsequent theories of evolution and so on.
Lead picture
So things are now. Yet to superimpose today's values on the days of the past is not only misguided, but arrogant. We cannot change how people thought in the 1800's. We can only strive to understand them.