They churned out what they thought was cool, and that people would buy. They weren't hamstrung by social media. It was a better time for creativity. Most of the things I love about D&D originated in the 2e era.
You can say hamstrung... but it also means that they very likely put out a lot of stuff that was unintentionally harmful (Orcs of Thar, as the most obvious one) because they didn't think to not do it. Like, take a look at Planescape. I love Planescape. The only reason I don't run it is because I don't think I'm suited for the type of cosmic situations that Planescape calls for; I do better on a smaller scale. But... look at the gods. Gods who are important to modern religions and modern people were treated as equal to the gods of fantasy worlds and fantasy religions, or even lesser. There would have been an uproar if they had plopped down figures from Abrahamic religions in the Great Wheel, but they saw no problem saying where the Hindu and Norse (Asatru) gods are. And earlier still (Deities & Demigods, Legends & Lore), those gods were statted out, so you could kill them if you wanted to.
You know how I feel about Ravenloft. But thieving, murderous, child-snatching "gypsies" were there from the Black Box--and Van Richten's Guide to the Vistani, produced much, much later on, went too far the other way, by making them into magical not-quite-humans instead of treating them purely as
people, like, y'know actual Romani actually are.
This isn't cool. It wasn't cool then, either. But most people didn't know that because the world was much smaller then. And those that did know had little way to talk about it. Send a letter to TSR and hope they would read it? Send a letter to Dragon magazine and hope they'd print it?
For all of its faults, social media at least gives people the way to say "this isn't acceptable" where they couldn't do so in any appreciable numbers before.