I think . . . that Gygax didn't create the drow to embody sexist and racist tropes intentionally, but rather pulled those tropes from the literature and mythology he was familiar with . . . and yes, his own sexism shone through . . .
But when called out on it later in life, he doubled down (on the sexism, not the racism).
But to be fair to Gygax, the "rehabilitation" of the drow didn't start until relatively recently and has been doled out in dribs and drabs by the current D&D team.
The drow in Salvatore's novels slowly went through the "Klingon Effect" where Drizzt (and his dad) were the only good drow, the rest consummate villains. Over time, Salvatore's drow characters grew in nuance, helped along by the "War of the Spider Queen" novel series (by other authors than Salvatore). But until recently, the drow were still a pretty "always-evil-race" (except Drizzt), just with more depth than the initial cardboard. In Salvatore's latest novels, there is a civil war being fought in Menzoberranzan, between Lolth loyalists and those who now reject the Demon Queen of Spiders and her evil ways. And the hero team discovered a "lost" civilization of goodly drow living under a glacier in the far, far north, the aevendrow. Web articles from WotC also introduce the lorendrow who live in a jungle down south somewhere. But these changes haven't been introduced to the game itself yet, and we really haven't learned much about the lorendrow since they were announced something like four years ago . . .