Unfortunately, even in Trek's fictional history, humanity had to go through some pretty devastating stuff.I hate to bring up politics here Are you blind to what is happening in the U.S. post Donald Trump's election? I ask because if anything, it shows HOW MUCH (and how many people) still harbor VERY prejudiced attitudes, and BOTH sides can an will resort to violence. We have a U.S. Administration that wants a return to the attitudes and values from a much earlier time in the 20th century; and while not a majority, it's a very sizable ;portion of the U.S. population.
Europe to in many countries also have large segments of the population (and leadership) that feel similarly as well.
Unfortunately, I don't think that socially, we've really made a lot of the gains you suggest; or that in general most of the the world's population believes such change is wanted/good. I wish it were different, I REALLY do - but I don't really think mankind will change all that much. We've been this way since formal Civilization began. There have been times of small pockets of progressive tolerance (even in ancient times); but overall they don't last.
I think humanity can change, but that the state of things may not improve as quickly as would be preferred.