We can learn about the importance of faith when we see how deeply he believed the message of the angel:
Now the birth of Jesus Christ took place in this way. When his mother Mary had been betrothed to Joseph, before they came together she was found to be with child of the Holy Spirit; and her husband Joseph, being a just man and unwilling to put her to shame, resolved to send her away quietly. But as he considered this, behold, an angel of the Lord appeared to him in a dream, saying, “Joseph, son of David, do not fear to take Mary your wife, for that which is conceived in her is of the Holy Spirit; she will bear a son, and you shall call his name Jesus, for he will save his people from their sins.” All this took place to fulfil what the Lord had spoken by the prophet:
“Behold, a virgin shall conceive and bear a son,
and his name shall be called Emmanuel”
(which means, God with us). When Joseph woke from sleep, he did as the angel of the Lord commanded him; he took his wife, but knew her not until she had borne a son; and he called his name Jesus. (Matthew 1:18-25)
We understand courage when we hear about the flight into Egypt:
Now when they had departed, behold, an angel of the Lord appeared to Joseph in a dream and said, “Rise, take the child and his mother, and flee to Egypt, and remain there till I tell you; for Herod is about to search for the child, to destroy him.” And he rose and took the child and his mother by night, and departed to Egypt, and remained there until the death of Herod. (Matthew 2:13-15)
We also learn about obedience. St. Joseph was obedient to Our Lord, even in the midst of great trials and danger.