He said it in a Good Friday service. That must have been an interesting service. Here's an excerpt:
Was that divisive issue a subject for Good Friday? For the first time in my ministry I felt it had to be. Those last words of Jesus would not let me escape. "When Jesus saw his mother and the disciple whom he loved standing near, he said to his mother, 'Woman behold your son!' Then he said to the disciple. 'Behold your mother!' And from that hour the disciple took her to his own home."
That disciple was John whom Jesus, the gospels affirm, loved in a special way. All the other disciples had fled in fear. Three women but only one man had the courage to go with Jesus to his execution. That man clearly had a unique place in the affection of Jesus. In all classic depictions of the Last Supper, a favourite subject of Christian art, John is next to Jesus, very often his head resting on Jesus's breast. Dying, Jesus asks John to look after his mother and asks his mother to accept John as her son. John takes Mary home. John becomes unmistakably part of Jesus's family.
Jesus was a Hebrew rabbi. Unusually, he was unmarried. The idea that he had a romantic relationship with Mary Magdalene is the stuff of fiction, based on no biblical evidence. The evidence, on the other hand, that he may have been what we today call gay is very strong.