Joseph, the husband of Mary and a descendant of King David, served as the foster father of Jesus, working as a carpenter and providing crucial protection and support for his family during significant events such as the journey to Bethlehem, the flight to Egypt, and the return to Nazareth.