The Joseph being referred to is not originally the Spouse of Mary, but is one of his forefathers.
In his apostolic letter on St. Joseph, Pope Francis notes how “After Mary, the Mother of God, no saint is mentioned more frequently in the papal magisterium than Joseph, her spouse.” As well, he points out, “Innumerable holy men and women were passionately devoted to him.”
The trust and devotion that is reflected by these facts is summed up in a unique three-word expression: Go to Joseph, or in Latin, “ite ad Ioseph.”
St. Josemaria, for example, includes the phrase in one of his spiritual counsels:
Joseph can tell us many things about Jesus. Therefore, never neglect devotion to him — Ite ad Ioseph: “Go to Joseph” — as Christian tradition puts it in the words of the Old Testament.
In his apostolic letter, Pope Francis explains the biblical roots of the phrase that has become a Christian prayer.
Popular trust in Saint Joseph is seen in the expression “Go to Joseph,” which evokes the famine in Egypt, when the Egyptians begged Pharaoh for bread. He in turn replied: “Go to Joseph; what he says to you, do” (Gen 41:55). Pharaoh was referring to Joseph the son of Jacob, who was sold into slavery because of the jealousy of his brothers (cf. Gen 37:11-28) and who – according to the biblical account – subsequently became viceroy of Egypt (cf. Gen 41:41-44). As a descendant of David (cf. Mt 1:16-20), from whose stock Jesus was to spring according to the promise made to David by the prophet Nathan (cf. 2 Sam 7), and as the spouse of Mary of Nazareth, Saint Joseph stands at the crossroads between the Old and New Testaments.