By comparing what he says about these virtues in his middle writings and what he says about them in his later writings, we can see that his turn away from the Darwinian free-spirited science of his middle writings explains why his later writings became so popular with the Nazis, who would have found nothing appealing to them in his middle writings.
I will consider here two of these virtues--justice and moderation.
Nietzsche claims that justice originates as exchange or barter (HH, 92). He sees this as the lesson of Thucydides' story of the meeting of the Athenian and Melian envoys: justice arises among those who are roughly equal in power, so that to avoid mutual injury, the parties negotiate the claims on both sides. "Each satisfies the other in that each gets what he values more than the other. Each man gives the other what he wants, to keep henceforth, and receives in turn that which he wishes. Thus, justice is requital and exchange on the assumption of approximately equal positions of strength. For this reason, revenge belongs initially to the realm of justice: it is an exchange. Likewise gratitude."
Thus, justice is initially "insightful self-preservation," but later this egoistic origin of justice is forgotten, and justice is assumed to be selflessness.
Of course, the disturbing teaching of the Melian dialogue is that where power is not equal, the stronger rules over the weaker. But Nietzsche points out that when the Melians refused to surrender, the Athenians were forced to fight them in a year-long siege, and thus the Athenian victory was costly. This shows us how the weaker gain rights against the stronger, Nietzsche observes, because the power of the weaker to inflict some damage on the stronger creates a kind of equalization of powers that can be the basis of rights (HH, 93). Even slaves can have some rights if the resistance of the slave to the master's exploitation can inflict some damage on the master. Nietzsche concludes from this that Spinoza was correct in declaring that "each has as much right as he has power" (Theological-Political Treatise, chapter 16). "The rights of others constitute a concession on the part of our sense of power to the sense of power of those others," and thus changes in power-relationships bring changes in the natural history of rights and duties (D, 112).
This is similar to what I have argued in some previous posts about how might does make right, in the sense that the natural human resistance to oppression forces oppressors to limit their oppression, and thus we derive rights from wrongs, deriving justice from our violent resistance to injustice. Animals do this in fighting those who would injure them. Human beings do this, but they can also use their mental powers of reason and language to formulate social rules of right and wrong that express this natural resistance to injury, and the sense that it's to the advantage of all to agree to norms of mutually beneficial exchange.
If neighboring societies fight one another for many years, Nietzsche suggests, and if their power is roughly equal, then neither side gains a decisive victory, and both sides suffer losses. If it's possible for some third party to mediate their dispute and establish peace between them, then they might become trading-partners, which increases their welfare and prosperity (D, 190).
The cultures of the past, Nietzsche thinks, have been based on violence. But what we need now is a gradual change of thinking and feeling so that "justice must become greater in everyone, and the violent instinct weaker" (HH, 452). A big part of this change comes as the "man of convictions" is replaced by the "man of science" (HH, 630). Conviction is the belief that one possesses absolute truth, and the struggle between conflicting convictions provoked a long history of violence. This explains, for example, the history of cruelty in persecuting heretics: "what is the burning of one man compared with the eternal pains of Hell for nearly everyone!" (HH, 101). A growing scientific skepticism about absolute truth weakens such motivation to violent cruelty.
Moreover, much of the unjust cruelty in past cultures came from a failure to feel or understand the suffering of the victims of cruelty. "That the other suffers must be learned; and it can never be learned completely" (HH, 101). Thus, the cultural evolution in understanding and feeling the suffering of others promotes an expansion of sympathy that brings a progressive expansion of justice.
As we have seen, Darwin also saw this expansion of sympathy as crucial for moral progress. Matt Ridley shows how this works through the expansion of exchange and the division of labor leading eventually to global networks of trade that foster peaceful cooperation. Steven Pinker shows how this cultural evolution of liberal humanism has brought a remarkable decline of violence both within and between societies.
While this conception of moral progress towards greater justice as manifested in declining violence and increasing cooperation is affirmed by Nietzsche in his middle period, he scorns it in his later writing as the "herd morality of timidity," which is expressed as "Hurt no one; rather, help all as much as you can," or as "We want that some day there should be nothing any more to be afraid of" (BGE, 186, 201). In Beyond Good and Evil, Nietzsche sneers at this. "Morality in Europe today is herd animal morality," which is the morality of the "democratic movement." He yearns for "higher moralities" than this (BGE, 202).
The Nietzsche of the later writings is nauseated by "this animalization of man into the dwarf animal of equal rights and claims," and he looks to the new philosophers of the future acting as "leaders" (Fuhrer) to do a revaluation of values that will create a new aristocratic morality for higher men (BGE, 203).
Similarly, Nietzsche affirms the virtue of moderation in his middle writings, but then he rejects it in his later writings as a disgusting virtue of herd morality.
In his middle period, Nietzsche sees free-spirited thinking as promoting moderation--particularly, in the cautious restraint in one's practical and intellectual life that avoids the religious inclination to intoxication or frenzy (Rausch) (HH, 114, 139, 149, 464, 631; WS, 212). The moderation of the free-spirit should not be confused with mediocrity or boredom, because this virtue actually belongs to a cheerful disposition of those who are cautiously self-controlled because they don't want an overheated enthusiasm to cloud their clear view of the world as it truly is (HH, 34; AOM, 230, 326). Modern evolutionary science helps us to know ourselves as we truly are by teaching us that since we have evolved as mortal animals on earth, we cannot pass over into a higher order beyond the transitoriness of human life on earth. Understanding and accepting our evolutionary transience as animals evolved from apes can protect us from that "faith in intoxication"--in the ecstatic feeling of exaltation--that has ruined the religious and artistic cultures of the past with delusional fantasies (D, 48-50).
Nietzsche explains that we need moderation as a moral and intellectual virtue to avoid the delusion that there are religious, artistic, or political geniuses who are "superhuman" (ubermenschliches) (HH, 143, 164, 441, 461; D, 548-49). Napoleon, for example, was eventually ruined by his delusions of superhuman grandeur. Evolutionary science refutes any belief that human beings as evolved animals can become superhuman (D, 49). Rather, they are human, all too human.
But in both his earlier and later writings, Nietzsche rejects moderation and yearns for Dionysian frenzy and intoxication (Rausch) (BT, 1; TI.ix, 8-10). This immoderate frenzy finally expresses itself in Nietzsche's ecstatic proclamation of the Superman, the Ubermensch, as a revelation that will redeem humanity and give eternal meaning to life: "I teach you the Superman. Man is something that shall be overcome" (Z, prologue, 3).
Nietzsche's Zarathustra is nauseated by the fact that "small people need small virtues" like the mediocrity of moderation. "At bottom, these simpletons want a single thing most of all: that nobody should hurt them." Their virtues have clever fingers. "But they lack fists, their fingers do not know how to hide behind fists. Virtue to them is that which makes modest and tame: with that they have turned the wolf into a dog and man himself into man's best domestic animal" (Z, 3:5.2).
In Beyond Good and Evil, Nietzsche scorns moderation as a virtue of "the herd man in Europe." Such virtues of the herd cannot satisfy the human need for leadership--for a Fuhrer like Napoleon, who had a superhuman genius for commanding. Parliamentary constitutions fail because of the futility of attempting "to add together clever herd men by way of replacing commanders" (BGE, 199; TI, ix, 37-44).
Later, Carl Schmitt was to elaborate this Nietzschean Fuhrer principle in denouncing the Weimar republic for its parliamentary weakness, and the decadence of its "last man" culture, and then in promoting the heroic leadership of the Nazis, moved by ideological frenzy free from any restraining moderation.
Of course, Nietzsche's defenders will say that the Nazis were guilty of a vulgar distortion of Nietzsche's teachings. But that only confirms a warning from Nietzsche in his middle period:
"For the despisers of 'herd humanity'.--He who regards men as a herd and flees from them as fast as he can will certainly be overtaken by them and gored by their horns." (AOM, 233)