Joseph’s holiness is not in question because he decided to divorce Mary when she told him she was with child. The important words of the Bible are that he planned to divorce her “quietly” because he was “a righteous man, yet unwilling to expose her to shame” (Matthew 1:19).
Saint Joesph was wholeheartedly obedient to God—in marrying Mary, in naming Jesus, in shepherding the Blessed Mother and her son to Egypt, in bringing them to Nazareth, in living quietly in faith and courage.