Hint: It has something to do with the very, very long name given to St. Joseph.
One of the most common names in the West and the Middle East is Joseph — José, Giuseppe, Josef, Ioseph, Yusuf, Iossi. It is the name of at least three notable biblical characters. In the book of Genesis, Joseph is Jacob’s eleventh son (the firstborn of Rachel), Yossef Ben Yaakov. In Christian Scripture, we find Joseph of Arimathea, the secret disciple who provided the tomb in which Jesus was buried. But, most importantly, Joseph is the husband of Mary, the mother of Jesus. That is, Joseph is Jesus’ putative father. This word, putative, is here key.
In the Bible, two seemingly contradictory etymological explanations for the name Yosef are found in the same passage. The first one relates the name Yosef to the root asaf, broadly meaning “taking away”: when Rachel finally conceives a child, we find her saying “God has taken away my shame.” But the name is also akin to a similar root, ysp, meaning “to add.” In the next verse, the biblical text reads “And she called his name Joseph; and said, may the Lord add to me another son.” (Cf. Gn 30, 23).
Now, among Spanish and Italian speakers, “short,” hypocoristic forms of the names José and Giuseppe are commonly used in affectionate, familiar ways: Pepe and Beppe, respectively. Whereas the English Joe is certainly short for Joseph, these Spanish and Italian forms are not derived from the shortening of the original name. Its origins are rather liturgical.
Until relatively recent times, it was customary that during the readings of the Sacred Scriptures in convents and monasteries, the reader would refer to St. Joseph, in Latin, as “Sanctus Josefus Pater Putatibus Christi,” St. Joseph, the putative (that is, recognized, acknowledged, assumed) father of Christ. The rather long title was eventually shortened to “Pater Putatibus” until it finally was reduced to just “P.P.” —hence Pepe; the Spanish “p” being pronounced “pe.”