My understanding, considering sales numbers from different industries, is that D&D is valuable to WotC (and, in turn, to Hasbro) for essentially two reasons:
1. Baldur's Gate (and friends)
2. Novels
Amazon/NY Times bestselling novels outsell RPG products by a wide margin, and their profit margin should be greater on a per-item basis because of fewer contributors and larger print runs. The latest Drizzt book or Dragonlance chronicle usually crack those bestseller lists.
Bestselling computer and video games outsell novels by an entire order of magnitude. The top echelon, which, IIRC, the Baldur's Gate series does not quite reach, make significantly more money than motion pictures, and the industry as a whole eclipsed Hollywood long ago. The same Hollywood that can pull in profits in the 100s of millions range on a successful release. How do you think D&D stacks up to those kinds of margins? How much do you think Hasbro (for whom once-mighty Atari is a division) cares what that curious little branch of the company does, as long as it doesn't poison its precious licenses?
The game, "D&D," probably isn't valuable the way "Monopoly" or even "Uno" is valuable. But "D&D," the brand name that includes multiple bestselling novel series, multiple top-selling electronic game series, and a certain amount of cultural notoriety... THAT's worth Wizards of the Coast's time, and it's even worth Hasbro's time.
Especially since WotC/Hasbro own a publishing company (no sharing those precious profits from the books...) and an electronic game developer (... or from the games!). WotC and even TSR had the sense to do it with books, but the WotC-Hasbro-Atari triumverate is one of the most impressive corporate synergies I've ever seen. Ironically, D&D makes it all possible without being terribly valuable as a paper RPG.
It's worth WotC/Hasbro's time to make D&D, and it would be worth their time if it leaked cash like a sieve. D&D is a brand of extraordinary value, today on par with, say, Star Trek. D&D the paper RPG is an afterthought product that strengthens the massive brand because it's the original form, it's what gets referenced on TV shows and in movies.
I have no idea how much money WotC, WotC's D&D branch or Hasbro as a whole make, off the top of my head. But I'm sure they make a lot off the D&D brand and comparatively little off the actual D&D paper RPG (or D&D minis, for that matter).