Despite his similarity to his grandson Luffy, Garp still sticked with the Marines. We now know that Garp really dislike the Celestial Dragons but he still is working under them.
Garp is doing it because he wants to save innocent civilians. He could have gone the same route as his son Dragon and oppose the Celestial Dragons, but he didn’t and in my opinion it’s pretty clear why not. He was and is still needed as the Hero of the Marines. If it wasn’t for him the Marines would probably have collapsed long ago. Imagine how frustrated he must have felt seeing the Celestial Dragons acting like trash for so many decades.
We’ve already seen his inner conflict during Marineford. He really wanted to help Ace and Luffy but his position didn’t allow him to do that. People tend to blame him for choosing the side of the Marines, but from his position there was no other choice than acting the way he did.
Garp is probably one of the most selfless person in the whole One Piece Universe. Sengoku mentioned 2 reasons why Garp didn’t like to talk about the incident in the God Valley.
The first reason Garp likes to keep quiet about the battle is one that never made it into the public record. Garp had to fight alongside a pirate.
The other reason is that Garp fought to protect the Celestial Dragons. It’s also the reason he never accepted the rank of Admiral, because he would be directly under their control.
I’m sure that teaming up with Roger didn’t bug Garp that much. Most likely he is really pissed to have to protect the Celestial Dragons and it’s pretty clear that he fought mainly to save the slaves since his moral code does not allow him to protect Celestial Dragons.
For me the impact of his selflessness is much bigger because he is probably a free spirit person like Luffy, but he endures the Government’s action for the sake of peace. The way he begged King Neptune to not lose trust into humanity is also evidence for how much he care for peace between every race.