He was possibly a widower (those who believe Mary was forever a virgin say that Jesus' brothers were from Joseph's previous marriage). As it was it is likely Joseph was likely at least twice Mary's age. One apocryphal church tradition says Joseph was about 90 when Jesus was born, living to be 111. Frankly, that's a bit weird to think that Mary would be betrothed to a man that old. But regardless of Joseph's age, his plans were about to change.
He had just been told by his fiancee that she was pregnant. It clearly wasn't his. Joseph loved her, but he knew the Law said not to go through with this. He didn't want her hurt, though. He didn't want her disgraced, publicly humiliated, or stoned to death, which was what was required according to the law. So he intended to do it quietly, preserving Mary's dignity as much as possible. I think his actions and intent point to Joseph being a class-act. Other men would have had her stoned. No one would have married a pregnant woman; to do so would have been to incriminate yourself as having defiled her before marriage. Out of love, Joseph wanted to keep everything quiet so that Mary didn't have to suffer.
But then that night an angel tells Joseph in a dream not to divorce Mary, but to go ahead and marry her, raising the child as her own. Joseph could have shrugged the dream off as having eaten too much spicy lamb a little to close to bed time, but he believes it. And he says yes. He agrees to become the earthly father of the Son of God.
I can't imagine the pressure on Joseph. How could he ever live up to being a good father when Jesus knew the Heavenly Father intimately? How could he pass on his carpentry skills to his son, who just so happened to have created the world? How could he love and discipline and raise the One who would save all people from their sins?
Saying yes didn't make his life easy. It doesn't make our lives easy, either. Never trust a minister who tells you that your life will be happier, more prosperous or safe if you accept Jesus as your Savior. Because it won't. Joseph would tell you that as he had to go on the run with his new family to escape Herod's murderous intent. Mary would tell you that as she stood at the foot of the cross.
But they would also tell you that saying yes to God can change the world. It may not always be easy, but it is good in the purest sense of the word (remember Mr. Beaver's description of Aslan in The Lion, The Witch and The Wardrobe? "Of course he's not safe, but he's good).
I don't like living next to drug dealers whose garbage is constantly strewn around my house. But I also believe that my saying yes to God means that I'm supposed to love them (and frankly, sometimes love means calling the cops). I don't like that the packages with Christmas presents that were delivered last week weren't on my porch when I got home. But when we said yes to God, He asks that we be light in dark places. I don't like having to forgive the person who had done me wrong, but if I say yes to God's forgiveness I must also forgive.
Joseph said yes, despite all the possible consequences, and I can't help but believe that Jesus' life was shaped in some way by having Joseph as His earthly father.