Almost all our behaviour is a combination of a genetic basis, that kind of forms a certain baseline, but, especially when the brain is involved, environmental exposures, learning and other feedback modulates the outcome (after all, the brain requires input to develop). So the question of nature vs nurture is, based on what we now know, mostly nonsensical. There is no versus, there is an end. The only part that is often unknown is how much. Also note that many of these non-genetic exposures can happen before birth- exposure to hormones but also chemicals in the womb affect early neuronal development.
And yes, homosexuality has been observed in at least 1,500 species, suggesting that it is a common, low-frequency outcome of how sexuality is wired https://doi.org/10.1038/s41559-019-1019-7.
There have been quite a lot hypotheses why it may arise, and why genes favouring homosexuality persist. Note that genetics is not a 1:1 carbon copy of traits. Combination of genes can result in a wide diversity of traits which can be quite different from the parent. If it wasn't, there wouldn't be any benefit to sexual reproduction and we would more likely continue to procreate e.g. via parthenogenesis.
What seems to be the case in humans is that the foundation of sexual orientation is laid early in childhood and, once developed, it is fairly stable. I think it is not yet known if and how much flexibility there is in the developmental path to sexual (and other) identity. There are suggestions that events in early fetal development already could be an important factor. One clue is the fact at least in men, the birth order sees to have a highly reproducible impact. Across many groups men with same-sex attraction have a greater number of older brothers, than heterosexual men. One hypothesis is that had a male child have some sort of immune response that creates antibodies specific to protein involved in male brain development. These antibodies increase with each male fetus and somehow increase the likelihood of developing same-sex preferences. There is some vague support for that (mostly the enrichment of antibodies against certain fetal proteins in mothers with multiple male children), but evidence remains at the correlation stage.
So in short, it is complicated and not resolved yet.