SINGAPORE (Reuters) - A Singapore court has rejected a gay Singaporean doctor’s bid to adopt his biological child because he was born by a surrogate mother in the United States through a procedure not available for unmarried couples in the island state.

Singapore is in many ways a vibrant, modern society but it remains socially conservative and sex between consenting males is a punishable crime with a maximum penalty of two years in jail, although prosecution is rare.

Singapore is also trying to boost fertility among its citizens, and offers generous incentives to couples to have babies, but in-vitro fertilization is allowed only for married couples and surrogacy services are not available for anyone.

The man, in a homosexual relationship with a partner, paid $200,000 for a woman to carry his child through in-vitro fertilization in the United States after he had learned he was unlikely to be able to adopt a child in Singapore as a gay man.

A Singapore court ruled against his bid to adopt the child this week saying the steps he had taken to have the baby in the United States would not have been possible in Singapore.

“He cannot then come to the courts of the very same jurisdiction to have the acts condoned,” the court said.

“This application is in reality an attempt to obtain a desired result ... by walking through the back door of the system when the front door was firmly shut.”

The child, who is about four years old and is legally an American citizen, will remain in the care of the man.

The man, whose name has been withheld because the case involves a minor, is exploring his options in relation to the decision, his team of lawyers said.

“The primary reason that motivates him is that like any father he wants the best for his son, he wants his son to be legitimate in the eyes of the law and to ensure that he has all the necessary benefits to set him on the right path,” said one of his lawyers, Ivan Cheong.

Cheong said legitimacy would help with any future application for citizenship and access to certain welfare benefits, as well as removing a perceived stigma around illegitimacy “that you can’t really place a value on”.

Prime Minister Lee Hsieng Loong has said the country was not yet ready for same-sex marriage and he was prepared to live with the anti-gay sex law “until social attitudes change”.

A Singapore lesbian, gay, bisexual and transgender (LGBT) rights group, Pink Dot, said it was dismayed by the ruling.

“Singapore has chosen to reject a loving father’s application to adopt his own biological son based on an outdated view of what a family should constitute,” the group said in a statement.