The selection of Jean-Claude Juncker as the next president of the European Commission by EU leaders was bad news for David Cameron yesterday, but the real worry is what damage the Prime Minister's high-profile defeat will have done to public opinion about EU membership.

Mr Cameron made clear he would oppose Mr Juncker on principle even though he knew the odds were stacked against him. That is commendable. But he will not be judged on his willingness to stand up for his beliefs. He will be judged on his skill in persuading others of his point of view, and in that he had no success at all.

That failure has called into question his effectiveness as a negotiator within the EU. Mr Cameron has promised to renegotiate the terms of Britain's membership of the EU before putting the matter to a referendum, but his chances of achieving a new settlement for Britain look slimmer in the light of his defeat yesterday.

Ukip predictably wasted no time in declaring Britain's chances of renegotiation dead in the water under "Johnny No Mates" Mr Cameron. The Prime Minister was isolated with only Hungary for company while the 26 other EU leaders, including Britain's erstwhile allies Germany, Sweden and the Netherlands, sat together on the other side of the divide. Mr Cameron's posturing over many weeks about Mr Juncker, mainly for the sake of headlines to appease his eurosceptic backbenchers, ultimately achieved nothing and he failed to build any meaningful alliances that might have given him a greater degree of influence, both now and in the future.

There is no question that the Prime Minister is in a tricky position politically. A supporter of Britain's continuing membership of the EU, he must lead a party with a bad-tempered and vocal cohort of eurosceptic backbenchers who pose a threat to party unity; meanwhile, Ukip's populist right-wing anti-immigration and isolationist rhetoric has turned voters' heads in their hundreds of thousands. To have ignored that threat would merely have fanned the flames of public disgruntlement and presented Nigel Farage with an open goal. Ed Miliband would be in the same bind were he the current occupant of Number 10, Labour also having suffered at Ukip's hands in the recent European elections.

Mr Cameron had no choice but to oppose Mr Juncker's candidacy and appears to have done so with sincere conviction, yet he should have done it more effectively.

This Government's lack of influence in Europe reflects the Conservatives' decision to pull out of the leading centre-right EPP grouping in the European parliament and then fail to build other strategic alliances, preferring instead to become bedfellows with some dubious characters in the eurosceptic European Conservatives and Reformists. It reflects Britain's stance during the euro crisis, when the Prime Minister criticised his fellow EU leaders from the sidelines but offered little in the way of constructive engagement. Little wonder that nobody wants to play with him now.