Nietzsche is describing the history of moral development with respect to psychological types, the master and the slave types. This is the difference between the affirmative-active good vs. bad morality and the reactionary-ressentimental good vs. evil morality, for Nietzsche healthy and unhealthy morality respectively. The healthy, strong psychological type sees itself as good first of all, sees all health and strength and joy and risk as good for life, and consequently all that is not like this, all that is common and cowardly and weak as bad. The unhealthy, weak and reactive psychological type sees this strength and daring power, which itself does not possess, as therefore evil, calls it evil, and consequently sees itself as good, as not-evil.
Nietzsche traces the origins of the words for good and bad, showing how these ideas firstly originated in an aristocratic, noble type of man who called good all that is truthful, strong, noble and fair, and who called bad all that is untruthful, weak, cowardly and common. With the intervention of the Jewish religion, Rome was eventually conquered, the strong self-affirmative type was defeated at the hands of the weak, self-ressentimental type, and the morality of good and evil came to replace the morality of good and bad on the level of mankind generally. Nietzsche sees this morality of the common man, the morality of the good of the many against the morality of the good of the (healthy, strong) few, is the essence of modern democracy itself (indeed, the view of the "English psychologists" is incorrect and impotent, as Nietzsche notes, being a-historical and ignoring the actual development of the different mora senses. Moral values are not merely a "social utility"... although I am unfamiliar with Nietzsche mentioning Hume specifically in this text).
He parallels the development of the spiritual, moral sense with the political-moral sense, showing how the former arose from the latter, how the priests came to be the arbitors of moral values, priests who were essentially weak themselves and therefore who pushed the development of good vs. evil morality, against the "masters", against all that was naturally strong, healthy, aristocratic.
The slave type succeeded because it was more cunning, more crafty, more creative. The slave type in its devious creativity becomes a value-creator, giving birth to the values of good and evil out of the older values of good and bad. The master-morality may be seen as less of an act of values-creation than is the slave-morality, then, which is an important point to note. According to Nietzsche the slave type had to deliberately create a value to oppose and supplant the old values of the strong and powerful, those who controlled and dominated society. While the old aristocratic mankind was indeed a value creator, the weak, ignoble man learned too how to become a creator of values too, and indeed seems to have learned to become an even better creator of values than his aristocratic predecessors, if history is to be any judge on the matter.
Nietzsche does not despair, nor lose hope, he sees that this progression of moral development reflects the human power to value, to create values. Thus Nietzsche notes that what is needed is for mankind to learn how to wield this power to value, to become a true creator of values and a weigher of values. To this end a scale of valuation must be developed, a "rank order of values", and Nietzsche sees this as the next task of philosophy (and not only philosophy).