D&D is not the best-designed game I've played by any stretch, but I kinda regard it as the game equivalent of a burger from a big franchise.
There are people who can't stand McDonald's (and I used to be one of those people, actually), but it does a lot of things passably well, is comfortably predictable, and if you want to go out with a bunch of friends, it's a safe option that you can reasonably hope most will agree to.
Great food that's for a more specific palate? Not always, not necessarily.
Are there much better burgers than McDonald's? Boy, are there. But it's McDonald's, y'know? It's popular, it's not that bad, and it's accessible. And if you ask a person who's not a burger afficionado if they've heard of McDonald's, they certainly have. D&D is exactly the same for tabletop gaming. You'd be hard-pressed to find a person who is vaguely aware tabletop games exist and hasn't heard of D&D. And almost every tabletop RPG player has played D&D, which is FAR from true for any other game, even the most popular ones.
(seriously, before the pandemic if I suggested to my RPG friends a new game, and it was D&D or Pathfinder? I always had more than enough people. I ran a frickin' four-year campaign in PF and even when some people dropped out, there was never a shortage of new players. When I try to run a different, more focused game? I'm lucky if I can get a team together in the first place)