Are you implying they're not connected, that discrimination and diversity are unrelated? Your wording makes it sound like some kind of political debate trap you're setting. FWIW, I'm uninterested in arguing here why and whether there should be such laws, or justifying efforts to prevent discrimination. The existence of these laws is a fact, and you're free to study the history and legal precedents for why they exist. Here's a generic but decent starting point:
https://en.wikipedia.org/wiki/Discrimination