The resolution also condemned the denial of visas to Russian diplomats.
Since the summer, Iranian diplomats and ministers have been under strict movement restrictions when they are in the US. They are limited largely to the area around the UN headquarters in New York, the Iranian mission and the ambassador's residence.
The UN resolution, proposed by Cyprus on behalf of Bulgaria, Canada, Costa Rica and Ivory Coast, was approved by consensus without being put to a vote.
Unlike those passed by the Security Council, General Assembly resolutions are not binding but do have political weight.
Without naming specific countries, the text was mainly aimed at the restrictions imposed on Iran, as well as the visa denials to Russia's delegation during last September's General Assembly, diplomats said.
The resolution said the UN "urges the host country to remove all remaining travel restrictions imposed by it on staff of certain missions and staff members of the Secretariat of certain nationalities".
The UN "takes seriously" the travel restrictions and arguments of the "two Missions" that say they are hindered in their functions, the text added.
Tensions between the US and Iran have risen since May last year when President Donald Trump abandoned a 2015 multinational deal with Iran aimed at curbing its nuclear program and began reimposing sanctions.
In September, while participating in the annual General Assembly, Iranian Foreign Minister Mohammad Javad Zarif complained he was unable to visit the country's UN ambassador in a US hospital.
The UN also "expresses serious concern regarding the non-issuance of entry visas to certain representatives of certain Member States," the resolution said, referring to 18 Russian diplomats who were denied US visas, also in September.
They were supposed to participate in various UN committees until December.
According to UN diplomats, during a lunch organized by the White House in early December for members of the UN Security Council, Russia's ambassador to the UN Vassily Nebenzia stressed to Trump that the denied visas were damaging to the United States' image as host country.
The US president said he was not aware of the issue and asked his team to look into the matter, the diplomats said.
The visa refusals have led to work delays for the concerned committees. The UN is considering the possibility of hosting sessions in the Geneva or Vienna headquarters in 2020 if the problem continues.
Follow us on Twitter and Instagram to stay connected