While Sweden and Germany offered Mr Cameron encouragement, Labour leader Ed Miliband said the PM was taking the UK “closer to the exit door” of the EU, which posed a threat to the economy reported BBC.
UKIP leader Nigel Farage said Mr Cameron had been “utterly humiliated”.
But Health Secretary Jeremy Hunt said the PM had been “brave” to take on Europe and the debate had now changed.
Britain forced the vote in an attempt to block the selection of Jean-Claude Juncker, seen as a backer of closer political union.
But EU states voted 26-2 to appoint him president of the Commission in what Mr Cameron described as “a bad day for Europe”.
Mr Miliband said the prime minister now posed “a clear and present danger” to the UK’s future.
“David Cameron, by his own admission, is taking us closer to the exit door of the European Union, which would threaten three million jobs across the United Kingdom,” he said.
Mr Miliband said European leaders questioned the prime minister’s true intentions, which had prevented them from allying with him and was “bad for Britain”.
He said Mr Cameron’s strategy had “totally failed” and that he had been “comprehensively and humiliatingly” outvoted.
The health secretary also said there had been a “sea change” in the wider debate and that EU leaders “desperately” wanted the UK to remain a member and would be open to “concessions and compromises”.
Despite being one of the UK’s closest allies in Europe, Sweden backed the appointment of Mr Juncker.
But the country’s Prime Minister, Fredrik Reinfeldt, said after the vote that he knew closer union was not “for everyone”.
Mr Reinfeldt pointed to a document issued by EU leaders after the vote which accepted that the idea of an ever-closer union should not apply to all member states.