Just over 24 hours after Liverpool winger Sadio Mane was dismissed for a high challenge on Manchester City goalkeeper Ederson, Ritchie was only given a yellow card, despite an identical jump to Mane's.
Ritchie failed to make contact with Alfie Mawson, but Gallagher has suggested that the consequence of the foul was irrelevant and acknowledged that he would have sent off the Scottish international.
On Mane's challenge, Gallagher told Sky Sports News: "It's a red card. If you take into context that you see a player, his boot is five or six feet in the air and he is leading with his studs and coming in at speed. I fully accept that he is going for the ball but the law doesn't say that. The law says that he has led in a dangerous manner, he is endangering the safety of an opponent.
"We have to forget the consequence. He doesn't have to put him in hospital to seriously endanger the safety of an opponent, as we later saw in another game."
On Ritchie, Gallagher said: "If I was a VAR (Video Assistant Referee), I would have sent him off. If you put a split-screen on and look at the two challenges, the only difference is the outcome.
Ritchie has admitted that he was fortunate to avoid being sent off at the Liberty Stadium.