They didn't. When all you have is a hammer, everything looks like a nail.
D&D used to be stereotyped as a thing for nerds. Video games also used to be for nerds. Then we had a couple of generations growing up with video games, and then people started to say, "Hey I grew up playing video games and I'm not a nerd!" The overlap there, memes, internet communication letting shut-ins get out of their shell and gush about their hobby online, some good LOTR movies, WoW & other fantasy games. Pokemon probably played a HUGE role by being a mainstream fantasy phenomenon that entire generations grew up and loved (acceptance of their fantasy stuff led to growing acceptance of other fantasy stuff, like D&D). So did the MCU because comic books were "nerd stuff" too.
Back in 2005 when I was working at EB Games in a ghetto ass mall, even the wanna be thugs didn't shit on D&D once they had an idea what it was really like.
"Isn't D&D for nerds?"
"Nah bro did you see those Lord of the Rings movies or play World of Warcraft?"
"Yeah man those movies were pretty good."
"It's like that but we just hang out around a table and fight monsters and explore dungeons but we use dice instead of a video game. Half the time we're just having fun, kind of like a poker night where you just hang out and play games."
"Aw that's straight man. I didn't know it was like that."
By the early 2000's when people were questioning D&D it was because they were curious about it, and the huge cultural shifts made them question the old stereotypes. That curiosity led to acceptance, which led into trying it, which turned into, "Hey this is actually a lot of fun to play with friends!"