The Aadhaar leaks and the right to privacy arguments were not enough to get the bench to declare the Aadhaar Act as unconstitutional.
This is Chief Justice Dipak Misra's last week on the bench before his retirement on October 2.
Justice Ashok Bhushan says he "broadly agrees" with the judgement of Justice Sikri, which is the majority judgement.
In January this year, the Unique Identification Authority of India (UIDAI), which runs the Aadhaar project, initiated a police probe into a major security breach after a local newspaper accessed a database containing the identity details of more than one billion citizens, which was being sold for a meagre $8.
Indian media and digital security researchers have documented several instances of Aadhaar records apparently being breached both by sophisticated hacks - as in the most recent case involving a patch that reportedly weakened security measures in the software created to enrol new users - or by small-time fraudsters who have reportedly sold access to Aadhaar numbers for as little as £6 ($8).
The majority judgement of the court read down Section 57 of the Aadhaar Act of 2016, holding that private companies can not insist on Aadhaar numbers from citizens to provide services. Aadhaar act can not be regarded as a money bill. This act allows the state, any body corporate or person to demand Aadhaar from citizens for the goal of identification.
It also said that schools could not insist on children's Aadhaar numbers to enrol students, further adding that no child could be denied state welfare benefits for the want of an Aadhaar number.
Though it was initially linked to social welfare schemes, the unique identity was later tied to bank accounts, financial and property transactions, the filing of IT returns, and even mobile services.
Justice Sikri struck down Section 57 which permitted private entities to avail Aadhaar data from individuals and ruled that Aadhaar authentication data can not be stored for more than six months.
It's worth noting that the government had earlier made Aadhaar mandatory for availing a host of benefits such as schemes for the below poverty line category, LPG subsidies, midday meals in schools, etc. Justice Sikri said unique identification proof also empowers and gives identity to marginalised sections of society.
The Congress party which introduced the scheme, welcomed the court decision to prevent private companies from accessing peoples' Aadhaar numbers.