It condemned "the misogynist, hateful comments" it said had been made by Mr Trump about women and minorities.
It follows the release of a 2005 video last week in which Mr Trump makes remarks about groping women.
Mr Trump has apologised for remarks, which he described as as "locker-room talk".
He has also denied touching women inappropriately.
The motion was filed by Greens party MP Jeremy Buckingham to the Upper House of the NSW parliament.
It said: "This house... agrees with those who have described Mr Trump as a 'revolting slug'."
"It's clear that all reasonable and decent people find Donald Trump's behaviour obnoxious and that the world is hoping American voters reject his politics of hate," Mr Buckingham said in a statement.
Because there was no objection, the motion was recorded as having been agreed to by all of the lawmakers.
It was allowed only after the president of the legislative council determined that "revolting slug" did not amount to unparliamentary language. Parliamentary procedure prevents MPs from using "extremely distasteful" words.
Australians on social media were critical of the politicians with James Elliot Watson saying on Facebook: "I don't think it's wise for governments to condemn a bloke who they might have to work with as a world leader in future."
"What a spectacular waste of time. Glad to see the House discussing the real hot button issues as they relate to NSW," said David Kelley.
Others pointed out that Australian politics had its own share of problems.
"Why bother for a revolting slug overseas, try looking at our own backyard. Plenty of slugs in Australia," said Bradley Patterson.
"Australian politicians need to keep their mouth shut. They are no better because really that is all they are. And slugs is quite generous to describe them," said Katherine Fav.
Many top Republicans, including House Speaker Paul Ryan, have distanced themselves in recent days from the businessman-turned-politician Mr Trump.