The evidence for this claim comes from two extra-biblical gospels, the Gospel of Mary Magdalene 17:10-18:21 and the Gospel of Philip 63:33-36. Both contain remarks that Jesus had a special relationship to Mary or that he loved her more than any of the twelve disciples. One text uses the term companion to describe her. In addition, there is an appeal in the Phillip text where Jesus is said to kiss Mary on the lips. So the inference is that if he kissed her in public he must have been her husband.
Now the facts are these. First, almost all scholars question whether these extra-biblical gospels contain anything of value in terms of the historical Jesus. However, even if they did, the texts noted do not actually affirm that Jesus was married. In fact, the famous kiss on the lips text actually has a blank in the original manuscript right at the point where it describes where Mary was kissed. So it could be the lips or the cheek, which would simply refer to a kiss of fellowship. The term companion is debated as to its force. Most interpret the term as pointing to a spiritual relationship Jesus had with Mary because of the mystic character of the gospel in which it appears. So it does not allude to actual marriage at all, but to a fellowship that Jesus and Mary shared as believers.
More than this, we have volumes of texts about Jesus from the first five centuries. I have a series in my library of 38 volumes from this period. They are small print, single space, double columned texts of several hundred pages each. They include traditional orthodox texts and those that were rejected as heretical. In all of these materials not a single text describes Jesus as married and most assume he was not, as that was a basis for some arguing that priests should be single.
In 1 Corinthians 9, the argument appears that the spouse of those married should be supported. Had Jesus been married Paul could have clinched his argument by noting this fact. All of this leads to the conclusion that Jesus was single.
Taken from "De-Coding the DaVinci Code: Seizing the Mars Hill Moments" by Discover the Book Ministries.