the short answer is: survival of the species
The long answer is that reproduction has no function, because nothing in biology has a function, contrary to the impression one will almost certainly get when reading the textbooks without thinking deeply about them. Reproduction is a lot more special in this regard though, because it is the best example for why nothing in biology has any function. Without reproduction there would be no organisms, no evolution, and no life. In other words, the existence of life is entirely dependent on it having the property of being able to reproduce itself. Which in turn means, that the appearance of reproduction made life possible, which tells us that reproduction does not have "the function of propagating the genes of the organism, the species, life in general, etc.", but rather that all of those are byproduct of the property of genomes to reproduce themselves
I hope I was clear enough