Following the vote, Palestinian members of the Knesset shouted and tore up papers.
The law gives Jews supremacy over all non-Jewish Israeli citizens, which critics and members of the state's Palestinian minority called racist.
Barenboim recalled that in 2004 he had given a speech at the Knesset, in which he had spoken about the Declaration of Independence of the State of Israel.
He said he had called it "a source of inspiration to believe in ideals that transformed us from Jews to Israelis".
Barenboim said: "The founding fathers of the State of Israel who signed the Declaration considered the principle of equality as the bedrock of the society they were building.
"They also committed themselves, and us, 'to pursue peace and good relations with all neighbouring states and people'.
"Seventy years later, the Israeli government has just passed a new law that replaces the principle of equality and universal values with nationalism and racism."
Less than 500 words long, the Nation State law accords exclusive "national self-determination" rights – the right to decide Israel's national priorities, of both symbolic and practical importance – to Jewish people, wherever they may live, in Israel or abroad, and whether or not they even hold Israeli citizenship.
The law does not, notably, say that Palestinian and other non-Jewish citizens of Israel are entitled to equal treatment under the law.
The law also gives Hebrew superior status over Arabic, making the former the state's only official language and demoting the latter to merely a language with "special status".
In effect, the Nation State law, which as a fundamental law holds constitutional power, means Israel's ethno-religious character supersedes its democratic one.
Barenboim, who is general music director of La Scala, the Berlin State Opera and the Staatskapelle Berlin, co-founded, together with the late Edward Said, the West-Eastern Divan Orchestra, a Seville-based orchestra of young Arab and Israeli musicians.
As a citizen of Argentina, Israel, Palestine and Spain, he has worked for decades, through his music, to bring reconciliation between Israelis and Palestinians.
Writing on Sunday, Barenboim said: "Does the condition of occupation and domination over another people fit the Declaration of Independence? Is there any sense in the independence of one at the expense of the fundamental rights of the other?
"Can the Jewish people whose history is a record of continued suffering and relentless persecution, allow themselves to be indifferent to the rights and suffering of a neighbouring people?
"Fourteen years later, I still believe that despite all the objective and subjective difficulties, the future of Israel and its position in the family of enlightened nations will depend on our ability to realise the promise of the founding fathers as they canonised it in the Declaration of Independence.
"Yet, nothing has changed since 2004. Instead, we now have a law that confirms the Arab population as second-class citizens. It, therefore, is a very clear form of apartheid."
Rights groups say Israel has been discriminating against its non-Jewish citizens ever since the state was founded in 1948, pointing to dozens of Israeli laws that mandate preferential treatment to Jews.
However, the law will have a more significant, more lasting impact as it enshrines a two-tiered system of rights in a basic law.
Ending his piece, Barenboim writes: "I don’t think the Jewish people survived for 20 centuries, mostly through persecution and enduring endless cruelties, to now become the oppressors, inflicting cruelty on others.
"This new law does exactly that. That is why I am ashamed of being an Israeli today."