A corporation that allows people to make money off their properties with no royalties and no questions asked? That's above and beyond what you could expect from a company in terms of generosity and niceness.
It's similar to how Steam works with third party storefronts. Anything sold on the Steam store itself, Valve gets a cut from, but other storefronts can sell Steam keys without having to pay Valve at all. Why would they do this instead of
only selling Steam compatible games on their own site? Because it means that wherever people are
buying their games, they're
playing them on Steam. So Steam grows in the public gaming mindset, and eventually Steam libraries get so big that a lot of gamers don't want to use any other platform. And the more people playing on Steam's platform, the more people shop on their own store.
The OGL has a similar effect. Other publishers make money off of the D&D name, yes, but the name grows, far outstripping that of any of their competitors, which translates into sales. The only time that
wasn't true was the last time they tried to kill the OGL. The combination of a industry that grew around a relatively open standard and a D&D that decided it didn't want to be
part of that open industry resulted in D&D suffering, not the industry. Note that D&D came right back to the OGL in 5E.
So letting others use (some of) their IP without royalties made the industry grow around them, and having it grow around them benefitted them
vastly more than a normal licensing set up would have. In fact, they kind of got screwed over when they
did engage in normal licensing when they sold Atari exclusive game publishing rights.