Before the assembly voted on the text, the 193-member world body had narrowly voted to require a two-thirds majority for approval as sought by Arab nations, rather than the simple majority urged by the United States.
Eighty-seven countries voted in favor, 57 opposed, and 33 abstained.
Haley, who steps down from her post at the end of the year, has repeatedly accused the United Nations of having an anti-Israel bias and has defended Israel in its latest confrontation with Hamas, the Islamist militant group that has ruled the Gaza Strip since 2007.
A Hamas spokesman said the outcome was a "slap" to President Donald Trump's administration.
Diplomats say the U.S. administration has lobbied hard to win votes.
Before the final vote, Haley reminded the chamber that last Friday the General Assembly voted six times in one day to condemn Israel.
He termed the vote against US-sponsored resolution as a victory in defiance of forces of tyranny in the world.
Haniyeh also appreciated the efforts put in by the Palestinian Authority through its ambassador to the United Nations Riyad Mansour, pointing out that the rejection of the US-drafted resolution strongly indicated that national concern is capable of uniting the Palestinian nation in facing of ongoing challenges.
There is no difference between Hamas, and Al-Qaida and Boko Haram, he said, adding that as the Jewish people are celebrating Hanukkah, the plurality of Member States of the United Nations has chosen to condemn Hamas.
"Our four countries will vote against the resolution".
US President Donald Trump has made a decision to name State Department spokeswoman Heather Nauert as the ambassador to the United Nations, a source. "This is a decision meant purely to disrupt adoption of the resolution the USA put forward", Haley charged.
Although some questioned why India wouldn't condemn Hamas as a terrorist organisation, New Delhi's position was complex and well thought through.
The US defeat at the General Assembly came as the Trump administration prepares to unveil long-awaited peace proposals, possibly in the first months of next year.
The Palestinians have severed ties with the Trump administration after the decision a year ago to move the US embassy to Jerusalem and declare the city Israel's capital.
The US administration has also cut more than $500 million in Palestinian aid.
Israel's UN Ambassador Danny Danon said the countries that rejected the draft resolution should be ashamed.
It condemns Israeli homes in the West Bank and reaffirms "unwavering support. for the two-state solution of Israel and Palestine, living side by side in peace and security within recognized borders, based on the pre-1967 borders".
The Palestinians see the city as the capital of their future state.