Throughout the PokƩmon games, there's a strong pattern in implying that Giovanni did truly liked running his gym and still feels nostalgic about those days. PokƩmon Masters made it pretty explicit in the recent chapter of the Arceus arc:
Giovanni's line about nostalgia for his days as gym leader is interestingly very similar to his line in Rainbow Rocket episode:
In both instances, he finds it weird to feel nostalgic about something he shouldn't. The difference is that in Pokemon Masters, its clearly about his former job as gym leader while in Rainbow Rocket episode, it's kept ambiguous but now given the similarities of those lines, we can safely conclude that he was similarly reminiscing about his old days as Gym leader in RR episode as well since he was facing a new young challenger for a battle like he used to as a gym leader. But in both cases, he feels like he shouldn't feel nostalgic about it since that's a part of his past that he moved away from ever since he formed Team Rocket.
That's actually not a new thing actually. This was hinted since the original Kanto games when you defeat him in his gym:
"TM27 is Fissure! It will take out PokƩmon with just one hit! I made it when I ran the Gym here, too long ago..."
The wording and ellipsis clearly suggests he's reminiscing of his past as a gym leader here. Not only that, but he says he made the TM for fissure (earthquake in later remakes) himself when he ran the Gym, clearly indicating that it was meant to be for his challengers who defeat him.
This is further confirmed in Pokemon LGPE:
"And this TM... A gift for a Trainer who dares take on the challenge of the PokƩmon League. TM41 contains Earthquake. It's a powerful attack that causes a massive tremor to deal damage to opponents. I made it...a very long time ago. Back when I ran this Gym, far too long ago"
Here, he explicitly confirms he made it as a a "gift" for the trainers who are about to face the PokƩmon league. If the Gym was truly just a front for his criminal activities, why would he bother to make a TM with the most powerful earth type attack (fissure/earthquake) as a "gift" for his challengers who manage to defeat him ? Why would he feel so nostalgic about his past days as a gym leader?
If his gym was truly just a front, why was it closed for so long while he was operating openly as the boss of Team Rocket?. If his job was just a front to hide his role as rocket boss, it would be the other way around. He would operate openly as gym leader and hide his role as TR boss. This clearly implies he used to run it in the past and then abandoned it when he formed Team Rocket.
Blue actually teases Giovanni about it in the recent chapter of Arceus arc and Giovanni's reaction is pretty telling:
Blue tells Giovanni he must understand that a gym leader's apprentices will get stronger since he used to be a gym leader, implying that Giovanni did have apprentices he used to mentor like Blue. Giovanni refuses to answer that while he could dismiss it. Instead, it gives him a real pause, implying Blue did hit a nerve. This fits with the pattern of Giovanni's conflict over his past as a gym leader.
TL;DR There's a strong pattern indicating that Giovanni was a genuine gym leader who did enjoy his job, training children, battling them and preparing them for the PokƩmon League. But for some unexplained reason, he later gave up a job he was truly passionate about to form team rocket and gain more power.