Saint Matthew's Gospel sheds only a modicum of direct light on the type of man St. Joseph was — but much can be gleaned about Joseph's character from the precious few verses of Scripture dedicated to him by the Evangelist.
Matthew describes Joseph as a "righteous man" (Matthew 1:19). In Scripture, this means a man who is devout and keeps God's Law (understood at the time as the Law bequeathed through Moses). During Christ's time, observing the Ten Commandments and their many derivatives (which were developed over the centuries, after Moses) was not an easy task.
Today, in a world dramatically altered by Our Lord's active ministry and preaching, we easily forget how cumbersome the Law of Moses had become, leading up to Christ's ministry. At the time of Our Lord, the Law of Moses was (after extensive additions that pertained to the good Jew's diet, the purification of one's person and home and so forth) very heavy — cumbersome, even.
Matthew the Evangelist's note that Joseph was righteous indicates that St. Joseph was exemplary in the practice of the Jewish religion, even with all its added weight. Few people alive today (except perhaps Hasidic Jews) could understand the burden it must have been to keep all the precepts of the Law, as compounded over the centuries.
I know myself: I would find it very, very difficult to refrain totally from eating pork. Much less could I comply with the manifold rituals involving self-purification and food preparation for the proper celebration of a Sabbath or a feast. I know I would find this infuriating. It's one thing to take a daily shower to maintain good hygiene; it's altogether another thing to go through a bath reciting prayers of purification. We Christians forget how heavy a burden it was to keep all the precepts of the Law during Our Lord's time. Yet St. Joseph was known to be a devout and righteous man in the practice of the Faith.
Now let's jump ahead two full millennia: Many these days struggle with keeping the basic Ten Commandments, so imagine modern folks attempting to keep the many precepts of the Old Covenant! Many Catholics today, for example, struggle to go to Sunday Mass with any consistency. They concoct excuses to altogether ignore the straightforward directive to "keep holy the Sabbath."
It's important to brush aside our modern tendency to deconstruct the requirements of our Faith; indeed, it's imperative to take St. Joseph's example of righteousness to heart. To be righteous in the eyes of God, we must keep all the commandments God has given us — not just the commandments we prefer.
Out of all the commandments modern Catholics like to ignore or pretend don't apply to them, the commandment to refrain from all sexual sins features most prominently. The Sixth Commandment, "Thou shall not commit adultery," is about so much more than just refraining from cheating on your wife if you are married!
To keep this commandment, a righteous man must refrain from all sins related to the deadly sin of lust. No pornography, no masturbation, no cheating on your wife if you are married and so forth. We are enjoined to be pure and holy (as God is pure and holy), to be chaste!
Of all the virtues with which St. Joseph is affiliated, chastity is, perhaps, most characteristic of the patriarch. In fact, buried in the "Divine Praises" that are sung to end Eucharistic adoration, one verse celebrating the purity and holiness of the head of the Holy Family stands out: "Blessed be St. Joseph ... most chaste spouse."
In statues and icons, St. Joseph is often depicted holding a white lily to symbolize his purity. The white lily in Joseph's hand signifies that Joseph had no relations with Mary, despite being Mary's husband. The Holy Family, comprised of Joseph, Mary and Jesus, was formed completely by bonds of obedience to God the Holy Spirit. There has never before been a family formed exclusively by such bonds, and there hasn't been one since! What made the Holy Family holy was their total fidelity to God and to God's Law as bequeathed to humanity through Moses.
To understand St. Joseph's role as foster father of Our Lord and the head of the Holy Family, we should take to heart St. Joseph's swift and immediate response to God in each instance wherein God spoke to him in his dreams through an angel.
Saint Joseph, like the Old Testament patriarch Joseph before him, experienced God speaking to him in his dreams. The first instance of this is set forth in Matthew 1:20, where the angel says, "Joseph, son of David, do not be afraid to take Mary, your wife, into your home, For it is through the Holy Spirit that this child has been conceived in her."
Key to understanding St. Joseph's character is comprehending that he believed what God communicated to him and that he immediately did what God requested of him, without any equivocation. Scripture evidences this well: "And Joseph took Mary into his home" (Matthew 1:24).
These days, few men give any credence whatsoever to dreams. And few men take any action based on what they have dreamt. Joseph, however, was totally obedient to God and let God decide who his spouse was to be — even knowing that no sex was involved! How many men would enter a marriage without the prospect of having relations with their wives?
In chapter two of Matthew's Gospel, we hear of God speaking a second time to St. Joseph through his dreams. We are not to understand this as meaning that God only spoke to St. Joseph through dreams twice during his life, but rather these were two instances that the Evangelist was familiar with that were relevant to the arc of his Gospel. In the account of the Holy Family's flight into Egypt (Matthew 2:13–15) the angel commanded, "Rise, take the Child and His mother, flee to Egypt and stay there until I tell you. Herod is going to search for the Child to destroy Him."
Note how the angel put St. Joseph on notice to wait for his word to bring the Child back into Israel. As with the previous passage, St. Joseph's response to God's direct intervention was immediate and complete. Joseph was thus an obedient descendent of Abraham. He did what God commanded him to do, with no qualms, even if this would entail great hardship and many trials.
For us as disciples of Christ, sons and daughters of God, St. Joseph's exemplary life of righteousness and purity is certainly something to be imitated. Moreover, if God should perchance speak to you in your dreams, don't brush this off, but take it to heart as St. Joseph always did! God may be asking you to take a direct part in His ongoing plan of redeeming this fallen world.