Some time ago, the UN decided to make a draft resolution called A/C.3/65/L.29 about extrajudicial killings, but then the African Group comes in and suggest an amendment to this draft resolution [they likely didn't support the text which singled out homosexuality specifically] (which was called A/C.3/65/L.29/Rev.1). The amendment was accepted, with 79 Yes, 70 No, and 17 Abstain (US voted No).
The resolution, with the amendment text, was
then passed overwhelmingly (165 Yes-10 Abstain, US Abstained). So it wasn't as if the UN actually voted to
change law, all they did was revised a draft resolution (basically a bill) before actually approving of it.
In context, here is Operative Paragraph 6 (b)...in all its glory, with the original draft of the resolution.
6. Urges all States:
b)To ensure the effective protection of the right to life of all persons under their jurisdiction and to investigate promptly and thoroughly all killings, including those targeted at specific groups of persons, such as racially motivated violence leading to the death of the victim, killings of persons belonging to national or ethnic, religious and linguistic minorities, killings of persons affected by terrorism or hostage-taking or living under foreign occupation, killings of refugees, internally displaced persons, migrants, street children or members of indigenous communities, killings of persons for reasons related to their activities as human rights defenders, lawyers, journalists or demonstrators, killings committed in the name of passion or in the name of honour, all killings committed for any discriminatory reason, including sexual orientation, as well as all other cases where a person’s right to life has been violated, and to bring those responsible to justice before a competent, independent and impartial judiciary at the national or, where appropriate, international level, and to ensure that such killings, including those committed by security forces, police and law enforcement agents, paramilitary groups or private forces, are neither condoned nor sanctioned by State officials or personnel;
Full Text