There is nothing wrong with homosexuality, but it just has no purpose in nature. It's not genetic, does that mean it arises from an error in biology?

No . Homosexuality is not an "error" in biology. It is not an error at all. Nor is it an illness. In fact, homosexual behavior is observed in many other species throughout the animal kingdom -- showing that it does, in fact, exist in many places in our natural world. Sexual orientation is individual, but there are no sexual orientations that are "errors". .
It's a trait. Like a lot of other behaviors / traits, homosexuality is primarily genetically determined. Evolutionarily, "errors" would eventually select out of a population. The fact that in humans and animals, homosexuality is present and seems to remain at a level percentage of the population means it likely confers some population benefit, even if the individual organism doesn't reproduce (naturally)
Wrong forum. This site is not to teach you science or to debate the purpose of life or why nature created life. There is homosexuality in all sexual species in the world. If you can tell us why God created this you have more insight than we do here on a Health Tap.