The branch of string theory which actually tries to match experiment is called string phenomenology. The state of the art in string phenomenology is that, starting from different forms of string theory (heterotic string theory, M-theory, F-theory...), it is possible to define space-time geometries, arrangements of branes, background fluxes... such that strings in the defined environment will behave qualitatively like the particles of the standard model.
The underlying reason why there are three generations in such a model really depends on the nature of its construction.
In an M-theory model such as those championed by Gordon Kane, the particles in a given generation correspond to states of M2-branes located at specific singular points in the compactification manifold, so the number of such generations is just the number of such singular points.
In a heterotic model such as those that Brian Greene has written about, it's more complicated. The topology of the compactification manifold permits a specific number of light left-handed fermionic states, and another number of light right-handed fermionic states; then left and right combine to make heavy states; and the generations correspond to the light handed fermionic states that are left over, that didn't pair up with anything. The original numbers of handed light states equal two of the "Hodge numbers" characterizing the topology, so in this case, there are three (or however many) generations because the difference between those two numbers equals three.
In still other models, the reason for there being three generations would be something else again.
Since the state of the art in string phenomenology is still just at the level of searching the vast "landscape" of possibilities for models that match experiment, any current explanation for "why three generations?" is going to lead back to contingent properties of the model that happens to be successful, like those that I sketched in Part 1 of this answer.
In evolutionary biology, they speak of proximate causes and ultimate causes. Why does a flower bend to follow the sun? The proximate cause is the set of molecules that it happens to be made of. The ultimate cause is natural selection - that's the reason why it's made of molecules that react like that, and not in some other way.
We can look at explanations like those from Part 1 as proximate causes of there being three generations. What are the possible ultimate causes?
One possibility is anthropic. Maybe we live in an eternally inflating universe where different string vacua are realized in different regions, and maybe e.g. the cosmological consequences of the CP violation that requires at least three generations in order to occur, helps make life, or even just stars, possible.
Another possibility is that it is just random. In genomic evolution, there's a lot of neutral evolution, features of the genome which are just contingent, which don't help the organism survive, but also don't hinder it, so those features aren't eliminated by natural selection. Anthropics can't determine everything, and maybe three generations is just a brute fact about how our corner of reality turned out.
Still another possibility is that it's the product of the natural dynamics of string theory. String phenomenology fixes the geometry of the extra dimensions (etc) and studies the results, but in fact you can have quantum tunneling between different geometries, and there may have been a lot of that in the early universe. The 2007 paper "Triadophilia" speculates that three-generation heterotic manifolds may be favored in this way.