he brandished them as anti clerical, i just wonder why?
Well, many of them were anti-clerical. There was not only rhetoric against priests, there was sporadic violent action against priests.
There is one pontiff for most of the process of Italian unification--Pius IX--depending on your definition of when the process began. Regardless, Pius IX is the pivotal pontiff in question, given that he served as pope from 1846 to 1878. After his election, he gave some signs of being not particularly hostile to enlightenment beliefs--political prisoners were freed, laypeople were invited into his administration, modernization in the form of railways was encouraged, and more. Then in 1848 one of his ministers was assassinated in broad daylight, and the revolutions of that year swept into Rome. The pope went into exile, and did not return until foreign powers intervened.
There is some debate as to how much these events changed Pius IX's ideology regarding liberalism. Some see his views as changing drastically, others explain his actions as consistent but acknowledge that he took a dim view of what he saw as the excesses of liberalism. Regardless, the policies he put in place were less encouraging to Italian unification in particular and liberalism in general. We also must acknowledge that contemporary liberals added their own antagonisms to the fray and were less than enthusiastic supporters of Catholicism.
So, when most of the territory of the Papal States was lost to the forces of Italian unification in 1860-61, there were a number of things that Pius IX clung to. He was confident that this wasn't anything unprecedented, since it had happened a dozen years earlier. He was assured of foreign support, as a contingent of French soldiers on loan from Napoleon III was the only thing keeping the papacy in control of Rome (it certainly wasn't force of papal arms). He was also sure that this process was hostile to Catholicism and the papacy, and given the statements made by some of the participants he was at least partially correct.
So, when the French troops were withdrawn in 1870 and the Italian troops moved in, Pius IX ordered only token resistance be made and declared himself a "prisoner of the Vatican." The Law of Guarantees that was unilaterally passed by the newly unified Italian state was rejected by the papacy--repeatedly. Pius IX issued the policy of non expedit, which called for Catholics to not participate in the new government as either elected or electors. That policy was inconsistently followed by Catholics and inconsistently applied by future pontiffs, and was later mitigated and finally dropped. A number of Italian politicians--including the new king--were excommunicated.
From his perspective, Pius IX need not have recognized that this new Italian state was going to persist. It certainly hadn't been the case in 1848--why would it be different now in 1870? Surely a foreign power would tire of this new entity and have a use for a friendly pontiff (either to curry favor with their own Catholic population or to have a pope in their debt), right? Well, we know that never happened, but it wasn't entirely unreasonable for Pius IX to take that position. He also had a front-row seat to liberalism in action, and that clearly convinced him that accommodation was a poor course of action and that confrontation was superior (regardless of how we might feel about his views). This is most clearly stated in the Syllabus of Errors, in which the conflicts between Catholic thought and liberalism were detailed by Pius IX in 1864. Given how he and his administration had been treated by liberalism as it was manifested in Italian unification, it becomes fairly easy to see why Pius IX was not an enthusiastic supporter.
I hope that answers your question. As always, followup questions from OP and others are encouraged.