late 14c., moralite, "moral qualities, virtuous conduct or thought," from Old French moralite (Modern French moralité) "moral (of a story); moral instruction; morals, moral character" (13c.) and directly from Late Latin moralitatem (nominative moralitas) "manner, character," from Latin moralis "of manners or morals; moral" (see moral (adj.)). Meaning "doctrine or system of ethical duties" is from mid-15c. Meaning "goodness, characteristic of being moral, virtuousness" is attested from 1590s.
Where there is no free agency, there can be no morality. Where there is no temptation, there can be little claim to virtue. Where the routine is rigorously proscribed by law, the law, and not the man, must have the credit of the conduct. [William H. Prescott, "History of the Conquest of Peru," 1847]