The new child welfare law in S.Africa made it tougher for foreigners to make families. The overall message is that children born in South Africa are better off in their own country, and foreigners need to show a commitment to living here if they want to use South Africans to help them make a family.
In the case last month, a Dutch and Danish couple won permission to use a surrogate. In the ruling, the court in Pretoria laid out guidelines that will now direct how future cases will be resolved.
Surrogacy has been legal in South Africa since 2006, and the constitution guarantees equal protection for gays, which courts have routinely cited in allowing same-sex couples to adopt or use surrogates.
For foreigners, the ruling essentially means that they must intend to stay in South Africa long-term. The couple involved in the case intends to settle here permanently, the court ruling said.
"If you are a French person or a foreigner here only for six months, it is not going to work, unless you live in South Africa for an indefinite period," said Anthony William, the attorney who represented the couple.
"This judgement is important because it sets the parameters and the guidelines."
South African law specifically prohibits commercial surrogacy. The court cast a wary eye on India, where the practise was allowed in 2002, creating an "assisted reproductive" industry that in 2008 was valued at $450 million a year.
This has attracted families from wealthier countries who hire Indian surrogates for far less than the process would cost in their home nations -- something South Africa is keen to avoid.
"Most countries prohibit commercial surrogacy, with India being the prominent exception," the ruling said.
The court warned that "particularly in countries such as ours with deep socio-economic disparities and prevalence of poverty, that the possibility of abuse of underprivileged women is a real and ever-present danger".
Every surrogacy agreement in South Africa requires approval from a court that must find the arrangement was reached "for altruistic rather than commercial reasons", the court said.
Surrogate mothers can only receive money to pay for expenses related to the pregnancy, such as health insurance or maternity clothes, said Jennifer Currie, founder of the Baby-2 Mom agency, which specialises in egg donations.
The rules have also been tightened for foreigners seeking to adopt.
Since a new child welfare law was passed last year, foreigners are required to live in South Africa for five years before they can adopt -- even though South Africa has 1.9 million AIDS orphans.
Most of those children are absorbed into extended families or communities and are not housed in institutions. Only about 600 are considered "legally adoptable", with just 200 children legally adopted last year, according to official figures.
The new law was drafted as Madonna was adopting her second child in Malawi, stirring controversy about wealthy foreigners taking home African children.
South Africa wants children to have a relationship "with their familiar cultural, physical and extended family environs before looking to adoption within the country or outside the country," said Seamus Mac Roibin, a child protection specialist for UNICEF, the UN children's agency.