The Israeli ambassador to the UN called the database a "blacklist" and said the body was acting obsessively against it.
But the Palestinian envoy said the move was a "message of hope" for his people.
Settlements built on territories occupied by Israel in 1967 are considered illegal under international law, but Israel disputes this position.
About 500,000 Jews live alongside 2.5 million Palestinians in the West Bank and East Jerusalem.
Thirty-two of the 47 members of the Geneva-based Human Rights Council voted on Thursday to adopt the motion calling for the establishment of the database.
None voted against the motion, while 15, mostly European nations, abstained.
The BBC's Yolande Knell in Jerusalem says the database will provide a resource for any organisation wanting to divest from companies involved in Israel's occupation of Palestinian lands.
It will potentially include a number of Israeli and international firms working in industries from banking to construction and security services, our correspondent adds.
The Palestinians have been campaigning for tougher sanctions against settlements.
The Palestinian envoy to the UN said that the passage of this resolution and others by the Human Rights Council were a "message of hope" to his people.
"Israel continues to systematically violate the inalienable rights of the Palestinians while enjoying impunity from the international community," Ibrahim Khreisheh added.
Israeli Prime Minister Benjamin Netanyahu called the body "an anti-Israel circus which attacks the only democracy in the Middle East and ignores the blatant violations of Iran, Syria and North Korea".
He added that it was absurd to condemn Israel rather than deal with attacks by Palestinians on Israelis and by so-called Islamic State in Europe.
Israel has criticised the UN Human Rights Council for voting to establish a database of firms doing business in settlements in the occupied West Bank.