Pakistan, making their first Champions Trophy appearance since 2007, equalised twice before Quemada's double sealed the win for Spain.
While the result means Pakistan cannot make the top four teams in the eight-nation event, manager Khawaja Junaid said his side had played well and a rebuilding programme ahead of the London Games remained on track.
'It's good for us to be here and see what level other teams are at,' he said.
'We're trying to improve. We made some mistakes but played good hockey...we're growing steadily. We've seen some good skills and good movement.'
Pakistan made a disastrous start when veteran Spanish captain Santi Freixa found the net after just two minutes, converting the first penalty corner of the match.
With Spain dominating early possession, Pakistan were forced into a counter-attacking game, looking to hit Spain on the break.
Muhammad Rizwan had a chance to equalise when he burst through the Spanish defence, only to miscue his shot with only Spanish keeper Francisco Cortes to beat.
Shakeel Abbasi had better luck in the ninth minute, when Cortes got a glove to his looping shot but could not prevent the ball dribbling over the line.
Gabriel Dabanch restored Spain's lead before half-time when he latched onto a pass in the Pakistan area and executed a deft turn to evade two oncoming defenders before scoring.
Pakistan's intensity lifted after the break and the reward came when Sohail Abbas, the highest scorer in world hockey, made it 2-2 with a trademark drag-flick goal from a penalty corner.
Pakistan created chances as Abbasi drove the attack but failed to convert them, while Quemada made no mistake slotting home penalty goals in the 57th and 65th minutes.
Freixa predicted the improving Pakistanis, who will remain in the tournament but cannot finish higher than fifth, would be a threat in London.
'They're growing a lot and looking to the Olympics they'll have a great squad,' he said.
In the other Pool A match, Australia had little trouble defeating Great Britain 4-1.
Chasing an unprecedented fourth straight title, the Kookaburras found their rhythm after a stuttering display against Spain in the opening round, with goals for Matthew Butturini, Matt Gohdes, Luke Doerner and skipper Jamie Dwyer.
Coach Ric Charlesworth said the scoreline would have been even more emphatic if the world champions had not squandered two of their three penalty corner attempts.
'We were much better today... but you're never happy with that sort of conversion rate,' he said.
Germany play the Netherlands and South Korea face New Zealand in Pool B matches Tuesday.