Farhadi boycotted the ceremony, with two Iranian-Americans representing him. "Dividing the world into the US and 'our enemies' categories creates fear," his acceptance statement read.
US courts have blocked the travel ban but the Trump administration is preparing a new executive order.
The original ban temporarily prohibited the entry of immigrants from seven Muslim-majority countries.
One of those chosen by Farhadi to represent him, Iranian-born US engineer and astronaut Anousheh Ansari, read out his acceptance statement.
The statement read: "My absence is out of respect for the people of my country and those of the other six nations who have been disrespected by the inhumane law that bans entry of immigrants to the US.
"Dividing the world into the US and 'our enemies' categories creates fear. A deceitful justification for aggression and war.
"Filmmakers can turn their cameras to capture shared human qualities and break stereotypes of various nationalities and religions. They create empathy between us and others. An empathy which we need today more than ever."
'Stand in solidarity'
The Salesman tells the story of a married couple who are appearing in a local production of Arthur Miller's play Death of a Salesman and whose lives are thrown into turmoil after the wife is attacked while alone at home, sparking the husband to seek revenge.
All six directors nominated in the best foreign language film category had signed a statement before the ceremony condemning a "climate of fascism" in the US.
Farhadi, whose movie A Separation won the same category in 2012, had organised a free screening of The Salesman in London's Trafalgar Square on Sunday.
London Mayor Sadiq Khan told the crowds: "President Trump cannot silence me. We stand in solidarity with Asghar Farhadi, one of the world's greatest directors."
In a recorded message, Farhadi said: "Despite our different religions, cultures and nationalities, we are all citizens of the world."
Donald Trump's original executive order, signed on 27 January, said that all travellers with the nationality of Iran, Iraq, Libya, Somalia, Sudan, Syria and Yemen were not permitted to enter the US for 90 days, or be issued an immigrant or non-immigrant visa.
Mr Trump said the order was not about religion, adding: "This is about terror and keeping our country safe."
The order was suspended after the Washington State attorney general argued it violated a clause in the US constitution. Subsequent rulings have rejected reinstating the order.'