It is notoriously tricky to set forth the causes of homosexuality. The infamous nature/nurture debate rages on, questioning whether genetic or environmental factors are to blame. Any parent should be able to recognize that these two categories cannot be so easily separated, however. Both nature (genetics) and nurture (environment and upbringing) play a large part in the genesis of same-sex attraction.
We are all born with specific elements of personality that will remain more or less unchanged regardless of our situation. This unique personality brings with it a set of unique vulnerabilities and strengths. Paradoxically, these strengths and weaknesses are often in the same areas.
Satan (as well as the nature of our fallen world) waste no time and no opportunity in attacking our strengths at those areas of weakness. While the underlying issues and insecurities of most people remain the same across the board, the ways in which these genetic switches are thrown and the exact effects they take are unique to each individual. This is why twins raised in the same way may exhibit divergent neuroses and struggles.
Some of us are born especially susceptible to homosexuality. This is the nature element in the equation. That susceptibility is activated by situations or events in the child's life. For some, the very circumstances of their carriage and birth can shape their adult struggles in very powerful ways. For others, an incident or history of sexual, emotional, physical, or spiritual abuse sends them into unhealthy patterns. For many others, the environment or their upbringing -- while sometimes not harmful in itself -- is sufficient to channel their brokenness into homosexuality.
One especially difficult truth to accept here is that events from birth and infancy are some of the most crucial and long-lasting factors in our adult development. The first years of life are the most formative and the infant the most impressionable. A mother's absence due to illness, divorce, death, or abandonment can affect a person for the rest of their life. A father's emotional or physical distance or harsh treatment can wound a child for life.
Another very hard truth is that childhood wounding is inevitable. The things that harm a child's personality may not even be in themselves sinful. What is important is not only the act but our reaction to that act. Indeed, it is our reaction that makes the vast majority of our trouble. A child has little choice in how to react. They are immature in development and experience, and they have no objective distance to access in their treatment of another's actions. This is even more true when the act is that of a parent, one in a role of trust and authority.
Only Scripture and the Holy Spirit can show us when and where wounding occurred. The child is often too young to remember, and both parties have trouble finding objective truth on their own. God is the only truly objective being. His Word and Spirit, gleaned through study and prayer, are the only things that can point out the important moments in life and place the responsibility where it should lie. We must not be the ones to place that responsibility, whether we are blaming ourselves or others. And when responsibility is divined, we must grieve, but we must not allow shame to direct our thoughts and actions. Forgiveness must be accepted from God and others, and the offense must be left in God's hands.
Below is a list of common sources of wounding. It is not exhaustive but should serve as a starting point. While reading it, please keep in mind that we must always allow God to show us the truth of our situation. We are not asked to go excavating our own souls. He is faithful to bring up what needs to be brought up.
-abuse (sexual, emotional, physical, or spiritual)
-absence or abandonment of a parent
-domineering parent and/or passive parent
(*This is especially harmful when the domineering parent is the mother and the passive parent is the father. Such disorder is confusing to a child who is looking for his or her own gender identity.)
-feelings of rejection from parents and/or peers
-constantly being told that they are "gay", "queer", "butch", "a sissy", etc.
-an overly close relationship with the opposite-sex parent (one that resembles a bond between friends or lovers more than parent and child)
-early exposure to sex or pornography
At root, homosexuality is an outward sexualization of a very valid inner need. The man who sleeps with other men desires only to embrace his own manhood and to be embraced by man. This principle has been dubbed the "cannibal compulsion". We are all attracted to others by their difference, by that which we see as exotic about them. This is the basis of all sexuality. Even when similar interests draw two people together, it is the ability they hold to surprise each other that creates and sustains the romantic element of their relationship. When a child cannot feel at peace with his or her own gender identity, they may see the signs of that gender in others as the exotic piece that can complete them. They therefore seek to "devour" the other in order to appropriate those elements.
This is a very broad and brief treatment of the causes of homosexuality, but even the information contained here can take a very long time to accept and process. Let me once more reiterate that God is the one who acts here and in all of our endeavours. Allow Him to guide you in your study of causality and sexuality.