mid-14c., diversite, "variety, diverseness;" late 14c., "quality of being diverse, fact of difference between two or more things or kinds; variety; separateness; that in which two or more things differ," mostly in a neutral sense, from Old French diversete "difference, diversity, unique feature, oddness:" also "wickedness, perversity" (12c., Modern French diversité), from Latin diversitatem (nominative diversitas) "contrariety, contradiction, disagreement;" also, as a secondary sense, "difference, diversity," from diversus "turned different ways" (in Late Latin "various"), past participle of divertere (see divert).
A negative meaning, "perverseness, being contrary to what is agreeable or right; conflict, strife; perversity, evil" existed in English from late 14c. but was obsolete from 17c. Diversity as a virtue in a nation is an idea from the rise of modern democracies in the 1790s, where it kept one faction from arrogating all power (but this was not quite the modern sense, as ethnicity, gender, sexual identity, etc. were not the qualities in mind):
The dissimilarity in the ingredients which will compose the national government, and still more in the manner in which they will be brought into action in its various branches, must form a powerful obstacle to a concert of views in any partial scheme of elections. There is sufficient diversity in the state of property, in the genius, manners, and habits of the people of the different parts of the Union, to occasion a material diversity of disposition in their representatives towards the different ranks and conditions in society. ["The Federalist," No. 60, Feb. 26, 1788 (Hamilton)]
Specific focus (in a positive sense) on race, gender, etc., "inclusion and visibility of persons of previously under-represented minority identities" is by 1992.