It's left a little ambiguous because obviously they don't know what would really work, but the timeline was roughly: WWIII -> Post-Atomic Horror -> First contact with the Vulcans, then the whole push into space getting humanity to pull together over the following couple of centuries would be when this happened. It wasn't just cultural stuff like caring about baldness, during that later period all sorts of things were solved, like hunger and various diseases.
Basically we had to hit our lowest point before we could get better.
The very premise of the show is that humans found a way to mostly move past the worst parts of their nature. Not just in Starfleet, but in general.
At least wrt. outside differences, I suppose it gets easier in a world full of "human with rubber forehead"-looking aliens.