Joseph was a "just man" and not spiteful: when he learned of Mary's pregnancy, he did not publicize it, but wished to divorce her privately (Matthew 1:19 footnote b). He was also very unselfish toward Mary during her pregnancy (Matthew 1:25).
Joseph was obedient to the Lord, as shown when he followed angels' commands to still marry Mary (Matthew 1:20-24) and flee to Nazareth to protect little Jesus from King Herod (Matthew 2:13-15). Joseph served as young Jesus's example of a righteous husband and father. The Bible Dictionary states, "Joseph was naturally regarded in Nazareth as [Jesus's] father, and the holy child treated him as such (Luke 2:48, 51)" (see also Matthew 13:55, Mark 6:3). It only seems logical that, knowing the influence a father has on his son and all the duties that come with fatherhood, Heavenly Father prepared Joseph for this calling just as He prepared Mary for hers.
I think the Primary song "When Joseph Went to Bethlehem" describes Joseph best:
I think there at the busy inn that he was meek and mild
And awed to be the guardian of Mary's sacred child.
Perhaps all through the chilly hours he smoothed the swaddling bands,
And Jesus felt the quiet strength of Joseph's gentle hands.
And close beside the manger bed, he dimmed the lantern's light
And held the little Jesus close upon that holy night.
Challenge: When you read the nativity story, remember Joseph as well.