St Ledger thought he had levelled in the 81st minute with a close range finish after Iker Casillas turned Stephen Kelly's header onto the bar, but his effort was adjudged to be offside.
The world champions were leading through Roberto Soldado's 69th-minute opener and they made the most of this reprieve as Juan Mata added a second in the 88th minute.
St Ledger said: "I went away celebrating, but it was actually a really good decision from the linesman, having seen it again. But it would have been a good feeling, obviously.
"I think Coxy (Simon Cox) was offside from Stephen Kelly's header. I don't know if that's right, I'm not sure.
"Obviously, Casillas touched it on to the bar. I don't know the rules these days, they keep changing and it's open to interpretation.
"On another day, you might have got it."
Spain had inflicted a 4-0 thrashing on the Republic in last summer's Euro 2012 final, but Giovanni Trapattoni's men were far more competitive and Conor Sammon spurned a chance to fire them in front.
Reflecting on the display, St Ledger said: "To be fair, I thought we actually did a lot better than we did in Poland.
"They are an unbelievable side for hanging on to the ball - but they do that to nearly every team in the world.
"We watched highlights of the France game and the possession stats were probably nearly just the same as here, so it's not just us.
"They are a fantastic side and I can't see any other winners of the World Cup next year."
Trapattoni was satisfied with his side, but admitted that Spain deserved their victory.
"The better team won - they are the champions of the world," said the Italian. "They controlled the game for 45 minutes, but we had a good balance and a good personality.
"We know the Spanish players, they are superior technically and they usually have more possession.
"Football is particularly strange because we had [the chance with] Sammon and the 'goal' was a goal. But that said, we have to recognise that Spain deserved to win."