One of the factors that influence sexual orientation is mental and social conditioning and therefore it can be shifted. An individual born straight can become a homosexual later on through external influences and a homosexual can also turn straight but it is more difficult and rare to achieve the latter than the former happening but is not impossible. There are many approaches that aim to convert a homosexual to heterosexuality and one of them is the religious approach which apparently is the one this guy took.
I realize that this is an unpopular opinion, but as a Christian, I can say that I feel like I have overcome these thoughts by focusing my heart on Jesus. I'm a virgin and never actually partook in homosexual acts or even dated another guy, but I had lustful thoughts about other men for years. And it's still a struggle to this day, but ever since I met Jesus and confided in other guys who care about me and pray for me about it, it's become easier in some ways.
Jesus has made me happier in the past few months that I've come to know Him than I ever was without him and struggling with these thoughts. But I realize that it's a personal decision for everyone and I don't judge anyone who feels differently.