It's funny how on a newspaper forum, people are so unaware of the latest news concerning the topic they're discussing.
As Ms Maggie has already explained, pedophilia is probably caused by some stunted emotional development. The pedophile never develops an adult sexuality for some reason. But that's pretty much irrelevant for most of us, because the only issue is that they not act on their attractions. The scientific details can be debated by the experts.
Homosexuality and other gender-sex variances such as transgender are a hereditary condition which people are born with. Epigenetic regulation of testosterone is responsible for the emergence of these variances. Homosexual men and transgender women appear to have parts of their brains feminized due to a lack of sensitivity to testosterone in parts of the brain.
Study Finds Epigenetics, Not Genetics, Underlies Homosexuality
Homosexuality as a Consequence of Epigenetically Canalized Sexual Development
I see you're still projecting your own bisexuality on to others. The weird thing is that most people deny the legitimacy of bisexuality. It takes a genuine bisexual to do what you're doing. I mean you've got to really know in your heart that bisexuality exists in order to project bisexuality on to others.
Lucky for us, a 2011 study has pretty much ended this debate. Bisexual people really do exist. Homosexual people really do exist. Heterosexual people really do exist. The whole 'that sexuality is really this sexuality' bull is over. These sexualities are valid and you don't get to project your sexuality on to anyone else anymore.
No Surprise for Bisexual Men: Report Indicates They Exist
Sexual arousal patterns of bisexual men revisited., Biol Psychol. 2011 Sep;88(1):112-5. Rosenthal et al...
Do you have any idea how much hatred is embedded in your question? You sound like an early 20th century eugenicist asking what purpose the lesser races have to exist. As if the master race is the only Human population whose existence could be justified. It doesn't matter what evolutionary purpose gender-sex minorities 'serve' and it is offensive to ask. No Human needs to justify their existence.
Asking your question as if it were some kind of scientific question is especially offensive since you've got it totally backwards. The fact that gender-sex variances are hereditary PROVES that they do benefit Humanity! Nobody needs to prove that to anyone else since NATURE ITSELF has proven it beyond any reasonable doubt. Nature loves reproductive variation and that's really all there is too it. Nature is constantly inventing new ways to reproduce, always trying to find something more effective.
The ethics of this issue should revolve around consent and autonomy, not the projection and enforcement of some ridiculously idealistic hetero-cis normativity that has never existed in nature.