Joseph knew the holiness of Mary and Her purpose of perpetual virginity perfectly.
The holiness of Joseph
Therefore, when he noticed Her pregnancy, he neither think that She was sinner, adulterer, nor exposed Her to the prescribed lapidation (Leviticus 20, 20; Deuteronomy 22, 22-24). As he believed the virtue of Mary, he would be no longer righteous man (Matthew 1, 19) if he made Her to be stoned to death.
But Joseph, before the angel appears (Matthew 1, 20-23) does not know the cause for which his spouse is pregnant and he cannot explain the fact.
And God through an Angel admonishes Joseph in dream to avoid rejecting his spouse, and exhorts him instead to take Her with himself quietly, because Her pregnancy was due to no other than God Himself.
The holiness of Joseph that is of the just man falls seven times and rises again (Proverbs 24, 16), shines immediately more brightly:
As he has immediately obeyed to the Angel (Matthew 1, 24);
As he has immediately decided to comply with God’s will (Matthew 1, 24)
The holiness of Mary shines of very special light in this terrible circumstance:
in order to obey to God, who wanted manifest Himself Joseph the inexplicable mystery, She said nothing to Her spouse, She suffered acutely for the long and burning anguish of Her spouse and for the danger "that a just failed, he who never failed...»
Truly, Mary and Joseph, also in this painful circumstance and test, appear «...two so great Saints that there aren’t greater ones in the world».
PrayerOh great saint for your perfect obedience to God, have mercy on me.
For your holy life full of merit, hear me;
For your dearest name, help me;
Clement for your heart, help me;
For your holy comfort my tears;
For your seven pains, have pity on me;
For your seven joys, comforted my heart.
From every pain of soul and body, make me free;
From every danger and disgrace keep me away.
Help me with your holy protection and obtain for me, in your mercy and power, what it is necessary and above all the grace of which I particularly need. You even beg, dear St. Joseph, intercede for the holy souls in purgatory and timely deliverance from their pains.