WASHINGTON—When war erupted in Gaza last year, the Biden administration hoped to keep the conflict short, stay closely aligned with Israel and stem the war’s spread to Lebanon and other parts of the Middle East.

Eight months later, achieving those goals is proving increasingly difficult for the White House, highlighting a political vulnerability for President Biden ahead of his face-to-face debate against the presumed Republican nominee, Donald Trump , on Thursday.

U.S.-led talks on a cease-fire to halt the war and free hostages held by Hamas have all but collapsed. Attacks by Hezbollah across Israel’s northern border have intensified, raising the Biden administration’s fears of a full-fledged conflict. And the White House and Israeli Prime Minister Benjamin Netanyahu have traded accusations over whether the U.S. has slowed arms deliveries.

The strains underscore Biden’s challenge of achieving a foreign-policy win ahead of the November U.S. presidential election, a win that would require agreement from warring parties operating under a very different timeline.

The Hamas leader Yahya Sinwar has shown little interest in concluding a swift cease-fire, and Netanyahu’s opposition to a Palestinian state has sidelined the Biden administration’s broader strategy for the region, including stabilizing a postwar Gaza .

Eventually the leaders will tire of war and favor a deal, but not as quickly as Biden hopes. “Their clocks are not synchronized with Biden’s,” said Aaron David Miller , a senior fellow at the Carnegie Endowment for International Peace. “They are much more in line with one another, and they are ticking much more slowly.”

Biden has tried to strike a balance between supplying Israel with arms while criticizing a military operation that has killed, according to local health authorities, roughly 38,000 Palestinians in Gaza, many of them women and children. That figure doesn’t distinguish between civilians and militants.

U.S. officials have touted the deliveries of food aid to the Gaza Strip, and its pressure on Israel to scale back a planned assault on the Hamas stronghold of Rafah so that it used fewer troops and is employing smaller munitions.

But acrimony with the Israeli leader recently spilled into the public, when Netanyahu aired a video message in English claiming the U.S. was withholding weapons from Israel. The Israeli prime minister doubled down on the complaints in an interview published Friday by the online publication Punchbowl News.

“There has been a great slowdown in the provision of the important ammunition and weapons,” Netanyahu said.

U.S. officials said Friday that they were mystified by Netanyahu’s comments. “There are no bottlenecks,” Matthew Miller , the State Department spokesperson, said Thursday.

Current and former U.S. officials said Netanyahu’s comments appeared to be driven by Israeli political calculations and insisted that the administration hasn’t delayed any weapons, except for a shipment of 2,000-pound bombs the White House has said is under review because of concerns over civilian casualties in Gaza .

Alon Pinkas , a former Israeli diplomat, said that the prime minister’s behavior is part of a pattern of instigating spats and confrontations with the administration to show he is standing up to the U.S. “This is 100% manufactured,” Pinkas said.

The shipment of 2,000-pound bombs was held up in May in the hope of forcing Israel to rethink its plans for attacking Hamas fighters in Rafah. Since then, Israel has retooled its plan for a two-division sweep through Rafah and has instead concentrated on sealing the border between Egypt and Gaza, conducting smaller-scale ground operations in the city and using smaller munitions in its airstrikes.

The White House fears that sustained fighting in Gaza could lead to a spread of the war to Lebanon. Israel and Iranian-backed Hezbollah fighters have been exchanging tit-for-tat fire over the Lebanese border since Oct. 7, when Hamas-led militants launched an attack from Gaza on Israel that killed 1,200 people, most of them Israeli civilians.

Biden’s proposed cease-fire plan in Gaza is the best way to head off a wider confrontation, according to U.S. officials. The plan would start with a temporary cease-fire and an exchange of Hamas’s hostages for prisoners held by Israel, followed by a permanent end of hostilities and an influx of aid and reconstruction money to Gaza.

While Netanyahu has said he favors the initial cease-fire plan put forward by Biden, the Israeli prime minister has yet to outline a workable blueprint for the long-term governance of Gaza, focusing instead on the military destruction of Hamas.

The Biden administration has called for revitalizing the West Bank-based Palestinian Authority in hopes that it can also administer the Gaza Strip once the Israel-Hamas war ends, should Israel be persuaded to accept a Palestinian state. But the Ramallah-based government is on the verge of financial collapse, in part because of a suspension of Israeli tax revenue after the Oct. 7 attacks.

Khaled Elgindy , a senior fellow at the Middle East Institute, said that both Netanyahu and Sinwar are paying lip service to favoring a cease-fire, but that both in fact gain a political advantage from the war.

Sinwar, he said, has seen Hamas’s popularity rise dramatically throughout the Arab world, despite the high level of Palestinian civilian casualties brought about by the war. Netanyahu’s ratings have been buffeted in Israel, and he is danger of being ousted after any peace deal, Elgindy said.

“Netanyahu would love nothing more than to have cease-fire talks drag out forever so that he can stay in power,” Elgindy said. “Because the moment that this war ends, the clock starts ticking to the end of his term.”

In public, the U.S. has blamed Hamas roundly for blocking the cease-fire and causing more loss of life in Gaza. But neither Biden nor his Arab partners have been able to exert any meaningful pressure on Hamas.

U.S. Secretary of State Antony Blinken has said that Netanyahu is committed to the Gaza cease-fire plan, and that if it doesn’t progress Hamas will be to blame. The onus, Blinken said after meeting with the Israeli prime minister, was on “one guy” hiding “10 stories underground in Gaza” to cast the deciding vote, referring to Sinwar.

David Satterfield , who until April served as U.S. special envoy to the Middle East for humanitarian issues, told a recent online event hosted by the Carnegie endowment that obstacles to a peace deal are the worst he has seen in 45 years. One difficulty, he said, is that the respective parties to the conflict, Israel and Hamas, aren’t worried so much about scoring political tangible gains in negotiations as about their own existence.

“This is a fundamental clash of interests, where any kind of calculus that works for all the parties involved—and one of those parties is a vicious terrorist organization—is very, very difficult to contemplate,” he said.

Write to Alan Cullison at alan.cullison@wsj.com , Michael R. Gordon at michael.gordon@wsj.com and Anat Peled at anat.peled@wsj.co