Here’s a simple figure that is supposed to explain the principle behind how ERVs provide evidence for common descent, regardless of whether they are functional or not:
That is of course a highly idealized diagram, and the real world is a bit more complicated than that, but the underlying principle is correct. It is the fact that we can find ERVs that show distributions in different species that imply the kind of branching process of descent with modification, the phylogenetic tree on the left side of the figure, that gives rise to the distribution of ERVs within species depicted on the right side.
To be sure, ERV insertions can happen to all the species depicted following split from a common ancestor, such that for example the Gibbon will have it’s own unique ERV insertions in addition to those depicted on the figure, that aren’t shared by any of the other species.
There are many ways in which such ERV insertions can support the theory of common descent besides merely the fact of their insertion position. For example, As you go further back in time, shared ERV insertions should diverge more in sequence from each other. That is to say, the blue ERV insertion shared between Gibbon and Human, would be expected to be more different from each other, than the blue ERV insertion between human and Chimp, because it would have had more time to accumulate mutations independently in the Gibbon lineage and the lineage leading to Humans.
Notice how none of this requires that the ERVs be nonfunctional.
A link that explains this sample principle and more, in much more detail, while also giving real examples, can be found here: Evidence for the Evolutionary Model - ERVs