The special motives for which St. Joseph has been proclaimed Patron of the Church, and from which the Church looks for singular benefit from his patronage and protection, are that Joseph was the spouse of Mary and that he was reputed the Father of Jesus Christ.
Quamquam Pluries by Leon XIII
Rome, 15 August 1889
(...) From these sources have sprung his dignity, his holiness, his glory. In truth, the dignity of the Mother of God is so lofty that naught created can rank above it. But as Joseph has been united to the Blessed Virgin by the ties of marriage, it may not be doubted that he approached nearer than any to the eminent dignity by which the Mother of God surpasses so nobly all created natures. For marriage is the most intimate of all unions which from its essence imparts a community of gifts between those that by it are joined together. Thus in giving Joseph the Blessed Virgin as spouse, God appointed him to be not only her life's companion, the witness of her maidenhood, the protector of her honour, but also, by virtue of the conjugal tie, a participator in her sublime dignity.
And Joseph shines among all mankind by the most august dignity, since by divine will, he was the guardian of the Son of God and reputed as His father among men. Hence it came about that the Word of God was humbly subject to Joseph, that He obeyed him, and that He rendered to him all those offices that children are bound to render to their parents.
From this two-fold dignity flowed the obligation which nature lays upon the head of families, so that Joseph became the guardian, the administrator, and the legal defender of the divine house whose chief he was. And during the whole course of his life he fulfilled those charges and those duties. He set himself to protect with a mighty love and a daily solicitude his spouse and the Divine Infant; regularly by his work he earned what was necessary for the one and the other for nourishment and clothing; he guarded from death the Child threatened by a monarch's jealousy, and found for Him a refuge; in the miseries of the journey and in the bitternesses of exile he was ever the companion, the assistance, and the upholder of the Virgin and of Jesus.
Now the divine house which Joseph ruled with the authority of a father, contained within its limits the scarce-born Church.
From the same fact that the most holy Virgin is the mother of Jesus Christ is she the mother of all Christians whom she bore on Mount Calvary amid the supreme throes of the Redemption; Jesus Christ is, in a manner, the first-born of Christians, who by the adoption and Redemption are his brothers.
And for such reasons the Blessed Patriarch looks upon the multitude of Christians who make up the Church as confided specially to his trust - this limitless family spread over the earth, over which, because he is the spouse of Mary and the Father of Jesus Christ he holds, as it were, a paternal authority. It is, then, natural and worthy that as the Blessed Joseph ministered to all the needs of the family at Nazareth and girt it about with his protection, he should now cover with the cloak of his heavenly patronage and defend the Church of Jesus Christ.
You well understand, Venerable Brethren, that these considerations are confirmed by the ,opinion held by a large number of the Fathers, to which the sacred liturgy gives its sanction, that the Joseph of ancient times, son of the patriarch Jacob, was the type of St. Joseph, and the former by his glory prefigured the greatness of the future guardian of the Holy Family. And in truth, beyond the fact that the same name-a point the significance of which has never been denied-was given to each, you well know the points of likeness that exist between them; namely, that the first Joseph won the favour and especial goodwill of his master, and that through Joseph's administration his household came to prosperity and wealth; that (still more important) he presided over the kingdom with great power, and, in a time when the harvests failed, he provided for all the needs of the Egyptians with so much wisdom that the King decreed to him the title "Saviour of the world."
Thus it is that We may prefigure the new in the old patriarch. And as the first caused the prosperity of his master's domestic interests and at the same time rendered great services to the whole kingdom, so the second, destined to be the guardian of the Christian religion, should be regarded as the protector and defender of the Church, which is truly the house of the Lord and the kingdom of God on earth.
These are the reasons why men of every rank and country should fly to the trust and guard of the blessed Joseph. Fathers of families find in Joseph the best personification of paternal solicitude and vigilance; spouses a perfect example of love, of peace, and of conjugal fidelity; virgins at the same time find in him the model and protector of virginal integrity. The noble of birth will earn of Joseph how to guard their dignity even in misfortune; the rich will understand, by his lessons, what are the goods most to be desired and won at the price of their labour.
Oratio ad sanctum Josephum
Ad te, beate Joseph, in tribulatione nostra confugimus, atque implorato Sponsæ tuæ
sanctissimmæ auxilio, patrocinium quoque tuum fidenter exposcimus. Per eam, quæsumus, quæ te cum immaculata Virgine Dei Genitrice conjunxit caritatem, perque paternum, quo Puerum Jesum amplexus es, amorem, supplices deprecamur, ut ad hereditatem, quam Jesus Christus acquisivit sanguine suo, benignus respicias, ac necessitatibus nostris tua virtute et ope succurras. Tuere, o Custos providentissime divinæ Familiæ, Jesu Christi sobolem electam; prohibe a nobis, amantissime Pater, omnem errorum ac corruptelarum luem; propitius nobis, sospitator noster fortissime, in hoc cum potestate tenebrarum certamine e coelo adesto; et sicut olim Puerum Jesum e summo eripuisti vitæ discrimine, ita nunc Ecclesiam sanctam Dei ab hostilibus insidiis atque ab omni adversitate defende: nosque singulos perpetuo tege patrocinio, ut ad tui exemplar et ope tua suffulti, sancte vivere, pie emori, sempiternamque in coelis beatitudinem assequi possimus.