The home ministry urged the court to reverse a 2009 landmark decision by the Delhi High Court which decriminalised gay sex.
The ruling overturned a 148-year-old colonial law which described a same-sex relationship as an “unnatural offence”.
The Supreme Court had earlier asked groups challenging the judgement to define “unnatural sex”.
Many people in India still regard same-sex relationships as illegitimate, but rights groups have long argued that the law contravened human rights.
Section 377 of the colonial Indian Penal Code defined homosexual acts as “carnal intercourse against the order of nature” and made them illegal.
In July 2009 the Delhi High Court described the colonial-era law as discriminatory and said gay sex between consenting adults should not be treated as a crime.
Until the high court ruling, homosexual acts were punishable by a 10-year prison term.
The ruling was widely and visibly welcomed by India’s gay community, which said the judgement would help protect them from harassment and persecution.
But it was challenged by political, social and religious groups who wanted to have the colonial-era law reinstated.