Barack Obama has good reason to ask what the present Israeli government has ever done for him.

When the White House asked it to halt construction of Jewish settlements in the occupied territories to give peace talks a chance, the building went on. After Washington pressed Binyamin Netanyahu to embrace the promise of Palestinian independence within months, the Israeli prime minister did his best to scupper any prospect of new talks.

Netanyahu even went so far as to publicly dress down the president of his country's closest ally by lecturing Obama on Jewish historical claims and the Arab threat in front of the press at the White House. The president was furious at the humiliation and the administration made it known in private.

Netanyahu was unperturbed and has continued to agitate in favour of Obama's domestic political opponents in a way that no other foreign leader would dare interfere in American politics.

Yet the president is expending considerable diplomatic capital and risking what remains of the US's tattered reputation in the Arab world to protect Israel from a Palestinian move to have the United Nations recognise what amounts to a unilateral declaration of independence.

At a time when the US is working to build ties with the new leaderships emerging from the Arab spring, it might be thought that Washington would hedge its bets over Palestinian statehood.

But Obama is is taking an unequivocal stand in favour of Israel in saying America will veto the Palestinian bid at the UN despite alarm in the Arab world. The former head of Saudi Arabian intelligence and ex-ambassador to Washington, Turki al-Faisal, this week warned that an American veto will make the US "toxic" in the region.

Whatever the foreign policy implications, Israel is primarily a domestic political consideration and Obama's position on Palestinian statehood is staked out with one eye firmly on the consequences at the ballot box and in dealings with Congress.

"The answer to American policy lies exclusively in the realm of American domestic politics," said Daniel Levy, a former adviser to Israeli cabinet ministers and now a US based analyst.

"Most American Jews do not vote solely on the Israel issue. They vote on the range of feelgood factor, socio-economic issues. But the political perception is that if an issue can cost you with a very small pool of voters concentrated in certain states, like Florida (a critical swing state in presidential elections), you try and neutralise it from doing you harm. And this issue is doing Obama harm."

Ghaith Al-Omari, a former adviser to the Palestinian leadership and peace negotiating team who now lives in Washington, agrees.

"There are a number of factors in the US decision to veto. One is that the US has the longstanding view that the UN is not the forum for these things because at the UN they risk losing control. But we also we are in a political moment here. We are in election time, and it's not the time that the president is wiling to expend any political capital over Israel," he said.

Obama won a sizable chunk of the Jewish vote when he was elected in 2008 but polls show that support has slid sharply with implications not only for his own reelection but for Democrats in Congress.

This week, Obama's party suffered an upset defeat in a New York congressional election in a heavily Jewish constituency. Israel was not the only factor at a time of high unemployment and economic stagnation. But a Public Policy Polls survey taken shortly before the election showed a majority of voters said Israel was "very important" in determining how they cast their ballot, and fewer than one in four Jewish voters approved of Obama's handling of Netanyahu.

That has implications for Obama's own reelection campaign in some swing states with significant Jewish populations, particularly Florida.

"For a while now, I've been hearing from my constituents a lot of dissatisfaction with the statements on Israel that have been coming from the president and the administration," a Democratic party member of Congress, Eliot Engel, told the New York Times. "He'll still get a majority of Jewish votes, but I would not be surprised to see that drop 10 to 20 points."

The president's political problems over Israel began with his early attempts to press Netanyahu to stop Jewish settlement construction in the occupied territories, beginning with a testy White House meeting between the two after the US president took office. Obama followed that up by telling American Jewish leaders that he would put some "daylight" between the US and Israel after eight years of George Bush consistently refusing to pressure the Jewish state - mostly with one eye on the strong pro-Israel views of Christian evangelical voters in the US - to move toward ending the occupation. More recently, Obama upset Israel supporters by stating the obvious in saying that a final agreement will see Palestinian borders largely follow the 1967 lines with land swaps.

The Democratic National Committee is attempting to win back Jewish supporters with a campaign to explain that the issues on which Obama is most criticised - his pressure on Israel to halt settlement construction and his recent statement that a Palestinian state should be based on the 1967 borders with land swaps - are intended to strengthen Israel's security not undermine it.

The Democratic party is also making much of the fact that Obama has repeatedly defended Netanyahu's government in the face of virulent criticism at the UN on issues such as Israel's 2008 assault on Gaza and the killing of nine Turks last year in the raid on a flotilla of pro-Palestinian activists.

Through it all, the White House has watched Netanyahu undermine Obama by brazenly cosying up to his opponents in Congress where Republicans are blaming the president for the Palestinian statehood bid because of a speech he made to the UN a year ago in which he alluded to just such a prospect.

"When we come back here next year, we can have an agreement that can lead to a new member of the United Nations, an independent, sovereign state of Palestine living in peace with Israel," Obama said in 2010.

The Palestinians are portraying that statement as "Obama's promise". The president's Republican critics in Congress say it is further evidence that Obama is hostile to Israel. So does Mitt Romney, a leading contender for the Republican presidential nomination.

"This vote and the course pursued by the Palestinians and others by others in the United Nations is another testament of the president's failure of leadership," he told CNN. "This would have been avoided, or could have been avoided, in my view, had the president made it clear from the very outset we stand by Israel, that we lock arm and arm. Instead the president tried to communicate to the Palestinians and to others that support their effort that, well, there may be distance between us and Israel."

Levy said the Republicans are likely to go on making an issue of it ahead of next year's presidential and congressional elections.

"Obama's Israel policy will be part of a policy narrative of the Republican presidential campaign and in Congress that Obama was weak with our enemies and harsh with our allies. They'll say he abused the relationship," he said. "Obama's problem in Congress is that now that you have a Congress almost completely shorn of realist, internationalist old school Republicans, the Republicans line up four-square behind the most extreme positions on Israel. And because the congressional Democrats don't want the Republicans to allow them to be able to use this as an issue against them, they line up with the Republicans. That means that the president's room for manoeuvre is even further diminished."

That can be seen in Republican moves, with strong support from some Democrats, to cut the the $500m in annual US aid to the Palestinian Authority if the UN general assembly votes to recognise a Palestinian state.

Steve Rothman, a member of the powerful House of Representatives appropriations committee, said the move is designed to protect Israel.

The House foreign affairs committee on Wednesday held a hearing on whether to punish the PA. The chairperson, Ileana Ros-Lehtinen, made her view clear.

"Despite decades of assistance totalling billions of dollars, if a Palestinian state were declared today, it would be neither democratic not peaceful nor willing to negotiate with Israel," she said.

Other members of Congress would go further. Representative Joe Walsh, who identifies with the Tea Party and has said that Obama "is not Israel's friend", submitted a resolution in support of Israel's right to annex all of the West Bank in response to the Palestinian move for statehood.

"My hope is that this will help buck up Israel," Walsh told Washington Jewish Week. "We're not going to get peace until the other side realises that they're dealing with strength, that Israel and the US are not going to back down."

The pro-Israel lobby has sought to ensure that Congressional support remains solid by sending 81 members of the House of Representatives on an all-expenses-paid trip to the Jewish state this summer to "gather information".

Obama is winning approval for his stand at the UN. But Levy says he should not expect Netanyahu to be particularly grateful for blocking UN recognition of a Palestinian state.

"It's not like once the Americans have delivered and gone out of their way and done all this, Netanyahu will say I'm calling off the attack dogs, I'm going to be neutral in your reelection campaign," he said. "We all know he's going to continue to be a nightmare for Obama. Obama's doing this for someone who will continue to be a fly in the ointment of American domestic politics for 2012 which he has had no compunction in stirring up."

Netanyahu will be in New York next week for the opening of the UN general assembly and to try to mobilise opposition to a Palestinian state. He plans to take a side trip to congratulate the Republican winner of the election in the congressional district where Obama's Israel policy cost the Democrats dearly.

• This article was amended on 29 September 2011 to clarify the intended political meaning of this sentence: "Obama [told] American Jewish leaders that he would put some 'daylight' between the US and Israel after eight years of George Bush slavishly refusing to pressure the Jewish state to move toward ending the occupation."