Let's start with the conclusion: GM-for-pay is okay.
In other words: there is nothing wrong with paying someone to run a game for you, or charging people for a game you're running.
I say that with some certainty but little experience: I always GM for free.
I GM for my friends, on my schedule, using the system and adventures of my choice (always with some player input). I buy the books I want, and everyone in my group helps me as needed.
On the other hand, a GM-for-pay typically runs games for strangers, often using the most popular system (like D&D 5e) and well-known settings. A group of friends can often negotiate a situation in which they can all play together with a stranger DM.
I think GM-for-pay makes sense for several reasons.
Preparing a module like Tomb of Annihilation or Curse of Strahd takes considerable effort. There is an important distinction here: I think learning settings and modules takes work. It can be fun, but the real fun as a GM, at least for me, is running the game with the players.
[And I found running ToA way more fun that just generating a dungeon randomly or whatever. It was worth the effort. But there was an effort].
Once a GM learns the material, they can run it countless times. While it remains exciting for new players every time, the GM might lose some of the fun because there is no sense of discovery that comes with experiencing it for the first time.
And, in a way, I feel bad that some of this effort is wasted: all the unexplored rooms, all the things that could have gone differently, etc. Running the same thing multiple times is interesting, It is just not as fun as doing something new. And, since you can't usually run the same module to the same people twice, you have the additional effort of finding new people if you want to do that.
There are also practical matters, such as buying setting books, paying for subscription apps, etc. These responsibilities usually fall on the shoulders of the GM. At the very least, it is fair to expect the players to contribute.
In short, given the effort involved, it’s completely fair for someone to charge for GM services if there's demand.
I see this as a win-win. More players can experience various systems, settings, and adventures without needing to invest heavily in preparation. You could do the same without touching money: a group interested in trying multiple systems could take turns GMing for each other. Being able to do it for money just makes the process easier in some circumstances. It also allows people who really like to GM to be able to get some money so can dedicate more time to this, do this a lot, and get better at it.
Another aspect that is probably overlooked is the idea of "Player systems" and "GM systems". I ran a D&D 5e campaign a while ago. It was fun, but I'm unlikely to do that again; I find 5e to be too much work for the GM. OSR games are much more fun for me to run.
When you look at GMs-for-pay, D&D 5e is the most common system offered. Of course, "official D&D" is always very popular, but I think the fact OSR games are easier to run also explains why paid GMs are less common (and the whole idea is less popular in OSR circles).
I have never actually paid a GM. But I started playing RPGs in a game store. It was free, but they encouraged me to buy a book; so it was not completely without interest on their part. And it was awesome.
Then I wanted to learn more and more systems. I went to conventions and signed up for tables without considering what the GMs got out of it. Later, I invited strangers to learn RPGs with me. It was fun, but not as fun as learning when I was a novice (and probably not as fun as playing with my friends). And it took time and effort.
I also played several games where the GM was testing his own system or setting. I didn't pay for that, but the GM obviously had an "ulterior motive". Some of these games were awesome, and some even became awesome books eventually.
[I have done the same thing as an author; in fact, nowadays most of the things I publish are specifically made because I want to play then. I play-test stuff with my friends].
In short... one day, I might pay to play a game. I think having the option is good, but it is not necessary. If you have time to spare (maybe a clear schedule or enough time to search for a perfect game in several places), and maybe some social skill, you can play free games endlessly. You can make new friends and rotate the GM role if you want.
When I was younger I had more time and less money, so the thought of paying for a game would never occur, but maybe I'd have played even more if I knew that existed (at a fair price!).
Paying for a game does not make it better or worse. It is like any other business.
I have friends who are great professional cooks; they enjoy making food, and cooking to their friends for free, but they also sell food, and it is equally tasty. I enjoy food even more when cooked by someone I like, but not every meal has to be like that.
I think a similar reasoning will apply to most fun activities: boxing, running, playing the guitar, chess, and so on. Sure, you can do it for free, and you can do it for fun; but there is still a place for professionals, experts, teachers, and tutors.
---
(On a final note, some people say GM-for-pay is intrinsically good because commerce is intrinsically good, as both the buyer and the seller can hope to be satisfied by the end of a transaction they freely agreed to. While I do see the merit in this argument, one could make a counter-argument talking about cigarettes, alcohol or whatever, which would be beside the point IMO).