A new date was not set for the suspended polls, initially scheduled for October 8, but the electoral commission asked for a delay of six months following the court ruling.
The ruling could end hopes that these would be the first polls since 2006 in which both Islamist movement Hamas and Palestinian president Mahmud Abbas's Fatah, which runs the West Bank, would participate.
Reconciliation attempts between the two movements have repeatedly failed.
"The court orders the implementation of the government's decision on the holding of local elections," court president Hisham al-Hatoo ruled before a packed courtroom in the West Bank city of Ramallah.
He said, however, that the judiciary in Gaza did not have the necessary "guarantees" in place for holding the polls.
The elections were initially to choose municipal councils in some 416 cities and towns in Gaza and the Israeli-occupied West Bank.
Hamas boycotted the last Palestinian municipal elections in 2012, but had been due to participate this year.
On September 8, the court suspended the polls following disputes between Fatah and Hamas over candidate lists.
A new date for polling day is expected to be set within a month.
Hamas immediately dismissed Monday's decision as "political".
"The high court's decision on the elections is discriminatory and ratifies the division" between Gaza and the West Bank, it said in a statement.
- Political move? -
Fatah and Hamas have not contested an election since 2006 parliamentary polls, which Hamas won -- sparking a conflict that led to near civil war in Gaza the following year.
Signup to our newsletter and follow us on Facebook and Twitter!
This year's vote was planned with 81-year-old Abbas under heavy political pressure as opinion polls have suggested most Palestinians would like him to step down.
There has been no Palestinian presidential election since 2005, and Abbas has remained in office despite the expiry of his term.
Some analysts saw Abbas's decision to call for the municipal elections as a failed gambit since he may have been hoping Hamas would repeat its 2012 boycott.
A poll in late September showed 60 percent of Palestinians believe the court decision suspending the polls was a politically motivated bid to scuttle the election process, according to the Palestinian Centre for Policy and Survey Research.
Xavier Guignard, an analyst focusing on Palestinian affairs, called the high court manoeuvrings one of the "techniques employed by Fatah to protect itself against defeat".
Hamas, labelled a terrorist organisation by the United States and European Union, had planned to support lists of candidates not officially linked to the movement to avoid potential sanctions if they won.
It was not clear if Hamas would still attempt to do so following the court ruling.
Despite repeated reconciliation attempts, Hamas and Fatah have failed to bridge their differences and form a unified administration for the Palestinian territories.
The municipal elections had been seen by some analysts as a test of whether the rivals could take a significant step towards reconciliation.
Their divisions are seen as among the key obstacles in efforts to restart Israeli-Palestinian peace efforts, at a standstill for more than two years.
The Palestinian parliament has not met since 2007, the year Hamas, buoyed by its 2006 election victory, seized Gaza by force, driving out Fatah in a week of deadly clashes.
Hamas caused a shock by winning the majority of seats in the 2006 polls, which were seen by some as the most transparent held in the Palestinian territories.
But the international community refused to accept a Hamas government, demanding that the Islamist group first renounce violence, recognise Israel and respect agreements signed between Palestinian and Israeli leaders.
There have been three wars between Israel and Palestinian militants in Gaza since 2008, and the strip has been under an Israeli blockade for nearly a decade.