Women who receive donations now can have a say on the background of the donor but donors will for the first time have the right under law to choose to whom they donate.
The office of the Health Minister, Reba Meagher, said yesterday the law was being changed because it was "in the best interests of the child for the genetic parent to have given consent to the circumstances surrounding the child's birth and upbringing".
Ms Meagher told Parliament: "To put this in another way, it will not be in the child's best interests to discover later in life that their genetic parent has a fundamental objection to their existence or the social and cultural circumstances in which they were raised."
The Greens MP John Kaye was attempting to win Coalition support to change the bill last night. He said the Assisted Reproductive Technology Bill gave "sperm and egg donors the ability to specifically discriminate against single mothers, lesbian and ethnic and religious groups".
Mr Kaye said the bill would grant "legal sanction to bigotry and prejudice".
"[It] sends an appalling message that it is acceptable to discriminate on grounds that are irrelevant. It will also reduce the availability of donor sperm to single mothers, thus increasing the amount of self-insemination. This can have negative health consequences in some cases."
The medical ethicist Leslie Cannold, from Melbourne University, said she found the NSW proposal "offensive".
Dr Cannold, who is on the infertility authority board in Victoria, said arguments for such provisions were that they encouraged more sperm and egg donors but she said it was discriminatory.
"The whole idea of donating is giving and I don't think you give gifts with those sort of conditions attached," she said.
The bill also contains provisions requiring sperm donors to register their names, enabling children to make contact with the donors once they turn 18.