Gallagher believes the referee did not see the challenge, however it was clearly spotted by assistant referee Stuart Burt, who instantly informed Taylor of the infringement.
And former referee Gallagher admitted he was taken by surprise when lengthy discussions over the challenge between Taylor and Burt resulted with the goal standing.
"Without a doubt he didn't think it was a foul," he told Sky Sports News.
"I thought it was a foul straight away. If you watch Andy Carroll he can't get the ball and he hasn't just caught him in the head he's caught him in the arm which has forced him to lose the ball.
"So it's definitely a foul but it's a foul the referee hasn't seen because if you watch the referee he just turns and goes back to the middle.
"If you look across the pitch at Stuart Burt he's got a great view in and he's signalled it and called the referee over and spoken about it.
"The longer it went on, I actually said it won't be a goal, so when it was given I was really surprised. All I can think is he hasn't given him enough information to change his mind.
"But I can only think from my point of view, if I hadn't seen something and an assistant has been big and strong and called me over and said I'm telling you 'I've seen this', I think I would ask him to convince him."
However, Gallagher backed Taylor for awarding both of Liverpool's penalties after James Tomkins denied Luis Suarez a clear goal scoring chance and later West Ham goalkeeper Adrian bought down Jon Flanagan.
And the Sky Sports pundit also believes referees must not look back on their decisions, allowing previous judgements to affect their next.
"I think it's a tough call, he can fully justify giving the penalty, the goalkeeper has a slightest touch on the ball but without a doubt he has gone through the player and taken him down," Gallagher said.
"I went through three generations of referees in the Premier League and I saw many great refs, Graham Poll was the best at what I call 'parking it, making a decision irrespective of what it is, and moving on and that's what the top referees do now.
"If you've got it right or wrong there's no good looking back, it's the next one that's most important."
Elsewhere, in the Premier League, Gallagher believes Stoke's Charlie Adam was let off two yellow cards by referee Lee Probert in Chelsea's 3-0 victory at Stamford Bridge.
The midfielder appeared to catch Andre Schurrle in the foot with a challenge which led to the Chelsea forward being taken off, but Adam escaped without even a booking.
Adam was also let off over a challenge on David Luiz but Gallagher is adamant that this tackle was not made with malice or spite.
"I think it's a yellow card, it's not worthy of a red card, I think he's low and not too far off the ball, it's not violent or endangering for me," Gallagher said.
"I think it's a yellow card again as the ball is up in the air and David Luiz comes from behind him and he has put himself in that position. But it's not a tackle that is made with malice, spite or unnecessary speed or force."