If the ultimate goal of the 'will-to-life,' as outlined by Arthur Schopenhauer, is for the benefit of the next generation, then how can homosexuality be understood?
Arthur Schopenhauer offered two solution to the problems caused in us by the 'will-to-life;' one is art and philosophy, but the better choice is becoming a sage. But Schopenhauer does not say who becomes these sages. Since gay people do not fall in love with members of the opposite sex, they do not lose their minds and then have children in the process. This frees them up to do the things that sages do. Being gay is actually an advantage.
It's suprising that in the proliferation of philosophical reflection on homosexuality or gayness, Schopenhauer has been left in the cupboard or, as some might say, the closet.
The following extract might throw light on your question. Briefly, while there is a 'will to life as it presents itself in the entire species', this will has both a general and an individual component. The individual component is the source of the paradoxical phenomenon, as Schopenhauer sees it, of homosexuality.
Although Schopenhauer clearly has vestiges of an "ethical" approach to homosexuality [He calls it time and again a "vice" (Laster)], he actually abandons completely any view of a divine order against which man sins either willfully or by immoral weakness of will. Rather, all sexuality is nothing but "the will to life as it presents itself in the entire species (627)." This drive becomes split into a general and individual component (the survival of the species demands my partner selection which I merely interpret, illusorily, as my choice or love) as well as into a variety of vicissitudes (as when it gets "diverted" [irregeleitet] into "perverse" forms). This fundamental splitting of the will accounts for the "unheard-of paradox" (unerhörtes Paradoxon) (659) or "paradoxical idea" (paradoxen Gedanken) (664) of sexual and in particular homosexual love - a paradox that is no longer moral but "scientific" in nature.
(John H. Smith, 'Queering the Will', Symplokē, Vol. 3, No. 1, special issue: The Next Generation (Winter 1995), pp. 7-28: 10-11; A. Schopenhauer, Die Welt als Wille und Vorstellung II. Zurich: Diogenes, 1977: 627, 659, 664.)
On one reading, Schopenhauer regards a general or species-wide drive towards procreation or 'partner selection' as simply a feature of the will to life. Sexual love is no part of this drive but the individual misperceives the nature of the drive and believes her- or himself freely to choose a loved one as if the drive weren't in control. One thinks one chooses to fall in love, and might not have fallen in love at all, but the impression is illusory. These are features of the individual component.
Schopenhauer acknowledges but doesn't really explain, or even attempt to explain, how the individual component may also express itself, not in the choice of woman for man or man for woman but of woman for woman and man for man in the 'perverse' form of homosexuality. Homosexualty is merely located among a 'variety of vicissitudes' with which sexual life is beset.
Yet this is not to criticise Schopenhauer's omission of explanation. After all, the 'paradox' of homosexuality is, he holds, a question 'scientific' in nature. He hands the question over to science; and as Smith points out, not immediately but in the second half of the nineteenth-century, both in Europe and the United States 'science' took it up. The names of Freud, Havelock Ellis, Richard von Krafft-Ebing, and Magnus Hirschfeld are familiar to us all.
Old Arthur is plain wrong. The goal is not human procreation. It’s the genes that want to procreate, or multiply. On the level of Dawkins’s Selfish Gene, homosexuality fits perfectly. Read his book. Or have a look at https://www.newscientist.com/article/dn13674-evolution-myths-natural-selection-cannot-explain-homosexuality/