His quote was from the press conference he gave on the plane to dozens of reporters in July 2013.
He was asked about homosexual priests in the Vatican when he said that line (he does not seem to have a problem with them), but he seems to be speaking about homosexuals in general.
News quotes…and official transcript below:
“If they accept the Lord and have good will, who am I to judge them?” he said. “They shouldn’t be marginalized.… They’re our brothers.”*
The pontiff broached the delicate question of how he would respond to learning that a cleric in his ranks was gay, though not sexually active. For decades, the Vatican has regarded homosexuality as a “disorder,” and Pope Francis’ predecessor Pope Benedict XVI formally barred men with what the Vatican deemed “deep-seated” homosexuality from entering the priesthood.
"Who am I to judge a gay person of goodwill who seeks the Lord?" the pontiff said, speaking in Italian. "You can’t marginalize these people."
He was responding to questions about whether there was a “gay lobby” in the Vatican.
"If a person is gay and seeks God and has good will, who am I to judge?"
…when he broached the delicate issue of how the Catholic hierarchy should respond to clerics who are gay, though not sexually active. In doing so, he departed from the posture that has long shaped papal thinking on gay priests.
"Who am I to judge a gay person of goodwill who seeks the Lord?" the pontiff told a news conference in response to a question. "You can’t marginalize these people."
Pope Francis reached out to gays, saying he won’t judge priests **for their sexual orientation **in a remarkably open and wide-ranging news conference Monday as he returned from his first foreign trip.
"If someone is gay and he searches for the Lord and has good will, who am I to judge?" Francis asked. "We shouldn’t marginalize people for this. They must be integrated into society."
Speaking to members of the press during a flight back to Rome from Rio de Janeiro after World Youth Day celebrations, Pope Francis responded to questions about the Vatican’s alleged gay lobby, by saying: “If a person is gay and seeks God and has good will, who am I to judge him?”
He hasn’t run into significant resistance to reform inside the Vatican, and joked that if there really is a “gay lobby” he hasn’t yet seen it stamped on anyone’s ID cards.
–The Catholic Herald
And here…ta-da!..is the official transcript from the Vatican via The Catholic News Agency:
Says the pope:
Then you spoke of the gay lobby. Mah! So much is written about the gay lobby. I have yet to find anyone who can give me a Vatican identity card with “gay” [written on it]. They say they are there. I think that when you encounter a person like this, you must make a distinction between the fact of a person being gay from the fact of being a lobby, because lobbies, all are not good. That is bad.
**If a person is gay and seeks the Lord and has good will, well who am I to judge them? ***The Catechism of the Catholic Church explains this in a very beautiful way, but says, wait a moment, how do you say… it says, [that] these persons must not be marginalized for this, they must be integrated into society.”
“The problem is not having this tendency, no, we must be brothers, because this is one, but there is another, another [problem]. The problem is forming a lobby of this tendency, a lobby of the greedy, a lobby of politicians, a lobby of Masons, so many lobbies. This is the gravest problem for me. And thank you so much for asking this question. Thank you very much!”