Putting forward the Centre's view, the Additional Solicitor General said that gay sex is a threat to society and it could not be decriminalised.
"Right to health of few persons cannot supersede Right to health of society. There has to be balance between them and it is for this purpose that Section 377 is there," Malhotra said.
The court was hearing a PIL filed by gay rights activists seeking courts direction to amend Section 377 of Indian Penal Code by decriminalising gay sex among consenting adults in private.
The IPC at present holds an homosexual act as an offence and the Section provides a punishment of up to life imprisonment for indulging in such acts.
Earlier, gay rights activists had contended that the government, by decriminalising homosexual acts, is infringing upon their fundamental right to equality by decriminalising homosexual acts on the ground of morality.
"The Constitution gives fundamental right to equality and it prohibits discrimination on the basis of sex. But the rights of 25 lakh homosexuals in the country are being violated," they had contended on Thursday
The IPC at present holds homosexual act as an offence and the Section provides a punishment of up to life imprisonment for indulging in such acts.
"Moral argument cannot triumph over the constitutional rights in a democratic society where fundamental rights prohibit any discrimination on the ground of sex," the activists had said adding that gays in the country don't have full "moral" citizenship and they are being treated as second class citizens.