When Joseph, Mary and Jesus were Her only members, She had a problem: Herod was after the Child. And who was instructed to do something about it? St. Joseph. An angel told him to take the Mother and Child and escape to Egypt. The Holy Family, the Church, fled to Egypt. When it was safe for the Child and Its Mother to return, whom did the angel instruct? St. Joseph. The Church returned but since it was not safe to return to Judea because of Archelaus, Joseph was instructed to return to Nazareth instead. There St. Joseph continued as protector of the early Church in Jesus and Mary.
Pope Pius IX had problems during his Pontificate. The Catholic laymen were up in arms against the Papacy. Austrian and Italian Bishops and Cardinals were both trying to influence the Pope. They were taking sides in the ongoing political struggle. The Pope was caught in between. He sees the Church being hurt in the contentions and he sees the Church needing help. He made a wise move as Popes always do. He called on St. Joseph to protect the Church, eventually declaring him as Patron and Protector of the Church. As if moved by grace he summoned Vatican I. Ecumenical councils do not really cure the defects of the Church; it merely makes the heretics and schismatics stand out so to be easily identified and corrected. It segregates those who are outside the Church.
Whether Pope Pius IX singled out the traitors within the Church wasn't clear. Antonio Rosmini seemed to have pointed out a few to him. But then, the men of the Church pounced on him in order to silence him. But St. Joseph was protecting the Church as he still does. Rosmini continued to write. And his writings fell into the hands of Pope John XXIII. Moved by efficient grace, he in turn summoned Vatican II. Pope Paul VI began to pinpoint the enemies from within. He died knowing that, though he tried to cleanse the men within the Church, he wasn't able to complete his task. He worried for the next pope.
Pope John Paul II's main concern was gathering and leading other sheep into the fold and encouraging those within. (The job of checking the ones within the fold if they were sheep or goats fell onto the lap of Pope Benedict XVI.) From the very beginning of Vatican II, the colors began to show: those who were for Christ and those who were against Christ. And this has been continuing up to the present. And apparently, a polarization was taking place, or shall we say, a great apostasy was on the rise? The sheep were standing on one side; the goats on the other.
St. Joseph did not convert Herod just as Christ did not cure Judas. Ecumenical Councils do not cure deviates. It can only make them stand out for what they are. That is how St. Joseph protected the early Church in (the person of) the Holy Family. The danger was pointed out to him and he merely shielded or protected the Holy Family from its enemies.
Sheep, like Christ, show the singular quality of obedience, "He was obedient unto death". Joseph, who was obedient to the Mosaic law, first wanted to divorce Mary; but he obeyed the angel and instead took her as his wife. Mary was obedient with her "fiat." Though she wanted to remain a virgin, she consented to be the wife of Joseph in obedience to the angel. Obedience is a sign of the presence of the theological virtues of Faith and Charity in the true follower of Christ.
On the other hand, disobedience is the sign of satan. Lucifer and Adam and Eve were disobedient. Disobedience to the declarations of the Holy Father is rampant. Some have even considered it as a new right akin to the right of choice.
Christ did not solve the problem of Judas. Neither did Joseph the problem of Herod. Neither will Pope Benedict who knows that the enemies of the Church are within her, even in the Curia, as Judas was in the Apostolic college. Like Christ, Pope Benedict would simply say: what you intend to do, do quickly, if you are thinking of disobeying, do so now so that the Church, the Mystical Body of Christ, may know where you stand and correct you charitably. Fraternal correction is a duty of the Church. These evils are part of God's providence because He can get a greater good out of it. Thus Christ's action must be ours. God has allowed the evils in the Church for a greater good that is not evident to us right now. So let it be, that the greater good may be accomplished.
This is the way St. Joseph protects the Church. And we see his hands even now. (Isn't the Pope's name Joseph?)(Painting is "Mary wedded to Joseph" by Michael Pacher, Vienna, 1495)