Several reasons, and none of those reasons are to make it better for the consumer aside from convenience.
Digital distribution is a prerequisite for business tactics such as DLC, micro transactions, games being unfinished/buggy to the point of being unplayable, and early access (aka paying to test someone's game when devs used to have to pay to test their game). Valve are the ones who popularized it on PC but also influenced it for consoles since it worked for Valve on PC. The first case was when Half-Life 2 was released, it required Steam even if you bought a physical copy it.
The rise of Steam from the mid to late 2000s was an ominous event that was met with blissfully ignorant cheers. As they became more influential, Steam marketed itself to producers as a far more lucrative alternative to physical copies of games, and at the disadvantage of players, physical PC games almost entirely evaporated around 2009.
Now the dominant market, Valve shat all over PC gaming and gaming as a whole, a lot of later "standards" they popularized (like our very current cries against loot Boxes and microtransactions) would be picked up by everyone else, especially the scumbag companies like EA.
In an interview, Gabe Newell implied that it was bad that developers pre digital distribution had to actually release a game that was playable since they couldn't just patch it later like they can on Steam or Xbox live or PSN.
I have only gotten two arguments in favor digital distribution. One is that "it's the future, get used to it" and the other is that it is more "convenient."
Not all technological advancements are advancements. If someone said that being forcibly chipped by the government is the future, does that mean you should sit back and accept it? Sure digital distribution might be good for the publishers, developers, and digital distribution marketplaces, but it's only advantage for the consumer is convenience of not having to use discs. On PC, most of my physical releases only require me to use the discs once to install the game, I never have to use them again, even on console is it really that big of a deal to get off your couch to switch out discs? Some people obviously think so. To me, that convenience isn't worth all the negatives that come with digital distribution, on top of the fact that you never actually own a copy of the game you are paying for with your hard earned money. Some people are willing to bend over and get molested by developers, publishers, and digital distributors just so they don't get up and change discs, but not me.
I play mostly on PC, and PC is by far the worst when it comes to getting proper physical releases. I personally refuse to pay for digitally distributed games, and I suggest everyone else do the same, but I make sure to buy the few physical releases that have the entire game on the disc, are DRM free, and don't require some "service" like Steam or GOG.
For higher priced games on PC, the publishers/developers would actually keep more of the money from the sale of the game if they released it physically. Steam and GOG take 30% of the sale. A physical copy costs under a dollar to manufacture, and if they sold it online via Amazon, who takes 15%, or sold it on their own online store, they would end up making more profit than selling it digitally via Steam or GOG.
Digital distribution is inherently DRM, there is no such thing as "DRM free" digital distribution, even if GOG claims to be.