Prejudice aside there is a common confusion between acts and orientation ... it is possible to be homosexual and exclusively have sex with women for example. The act is a choice, the orientation is, pretty much by definition, not.
One can choose all kinds of acts.
Similarly it is possible to act as a man or a woman (or anything else for that matter) regardless of biological gender. It is possible to act as what you are not: theater depends on this (and causes problems for some people that way too.)
Religions and other ideologies commonly prohibit acts rather than orientations, but tend to label people by their acts too. The thinking is "you are what you do"... or, more, your act has revealed your inner nature.
i.e. stealing may be prohibited - and a person who has chosen to steal (for whatever reason) is "a thief" ... always has been and always will be but has shown their nature by their act: goes the thinking - once a thief always a thief. We've heard this before.
But some choices are not always choices - if we focus on the immorality of choosing to steal, and label the offender, we may be able to convince ourselves we are not complicit in the crime (say by perpetrating a system where there is a starving mass of people who must steal to survive)... we become the good people and there are also bad people.
It is very convenient also if the underclass cannot escape - so the 2nd class status of women through big chunks of history. You cannot choose to be male of female - and some people are naturally inferior (or so superior and pure that they should be repressed for their own protection...)
These days, if something is not a choice there is a social and moral pressure, in those societies we are pleased to think of as "free", that it should be accepted in some way... for people who have some interest in repressing homosexual acts (usually among other acts) it is convenient, therefore, if homosexuality is a choice. They can claim to be moral, and continue their way of life.
For those people, there not many responses available to the mounting evidence:
1. maintain the "you are what you do" and call homosexuality a choice - therefore we can oppress/help/cure them
2. accept a split between acts and nature - and suppress the act
3. give up - focus on things that are actually harmful
The #1 groups get a lot of press...
The #2 groups tend to treat homosexual acts as a kind of addiction and try all kinds of "therapies" to "cure" gayness. It seems to be a crackpot industry now, like homeopathy.
There are a lot of social structures set up around a simple picture of sexual orientation - for instance: if you dress in a revealing way, then you want to have sexual approaches. We also have established social structures pertaining to sexuality - and ideas about them are seldom discussed. They make people uncomfortable.
i.e. If you are being cavity searched you may be able to request a same-sex officer to perform the search ... why? Well, there is a suspicion that an opposite sex officer may be getting a sexual thrill from the process - that may even encourage some groups to perform cavity searches more than strictly needed. But what if the same sex officer is homosexual - could a homosexual get a thrill off a cavity search? Should officers be made to disclose their sexuality? Perhaps we should allow homosexuals to request an opposite sex searcher? Which leads to the possibility that someone may claim to be gay in order to get cavity searched by someone they find attractive. Maybe someone is best advised to request a same-sex but heterosexual officer to avoid giving someone a thrill? Why not give someone a thrill - maybe they'll be too excited to notice the contraband? Or perhaps it shouldn't matter? Clearly there is a lot to talk about - and the discussion has barely started.
It's more complicated by the situation with children - feelings run higher there. We segregate childrens changing areas at school. Why?
Somewhere in the back of the collective mind is a worry that the boys may rape the girls - perhaps being too young to exercise adult moral restraint. A lack of restraint in growing teens manifests in many other ways and it seems prudent to keep the sexes apart to avoid other forms of harm while they are becoming better socialized. But what about homosexual teenagers? Should there be 4 kinds of changing rooms and bathrooms? Should everyone end up with a private cubicle to change etc?
This sort of example speaks to fears - seldom articulated - and people are not good at thinking where fear is involved.
Thinking is hard anyway - most people seem to prefer some form of ignorance that resembles knowledge.
People like to stay comfortable.
This is all very general - the reason is because the question is very general.
People do stuff because they think they are, ultimately, doing the right thing. They believe stuff because they think they are correct to do so.
Why any particular person or group believes of does a particular thing can be quite specific to the group.
A lot of the answers above have concentrated on specific, if large, groups - religious people, people with strong dogmatic ideas etc.
There has also been a tendency to think of homosexuals as men for some reason.
Most of the time nonsense becomes mainstream, primarily, because nobody questions it.
It used to be, in NZ, that pregnant girls were no permitted to attend school. When the subject went up for discussion, it turned out that the main objection was mostly that some people were worried that (these girls were sluts and would corrupt the other girls, so that) pregnancy was catching. The nonsense of this was so self-apparent, once it was stated out loud, that the ban was, tentatively, lifted. iirc it was discovered that allowing pregnant girls into school reduced the teenage pregnancy rate - which everyone was so concerned about.
This is what we try to encourage here isn't it? The main threat science has to established dogmas is that questioning and disbelief is built-in.