District and Sessions Judge R K Gauba said there was nothing "illegal" or "improper" in the January 7 order of the magistrate.
"The metropolitan magistrate was not only within her rights, rather duty-bound to apply the provisions of section 327 (2) (conducting in-camera proceedings in cases of rape and related offences) of the CrPC to the proceedings of the case," the judge said.
"The fact that a large crowd had entered her courtroom leaving no space for even the undertrial prisoners to be brought in only added to the circumstances leading to passing of the order," the judge said.
On January 7, a magistrate had restrained the media from reporting and publishing the proceedings of the case in the court noting that the courtroom was jam-packed with members of the bar and general public who were unconnected with the case and not prepared to leave it due to which the accused could not be produced before her.
The sessions court said as per section 327(2) CrPC, it is mandatory for the presiding officer to hold the proceedings in-camera in cases of rape and related offences.
Noting that the arguments of the petitioner advocates that the case is still at the stage of committal and not trial, the judge observed, "Eventually, the trial court would also be required to regulate proceedings in terms of section 327 of the CrPC."
During the arguments, Public Prosecutor Rajiv Mohan opposed the plea saying the relief sought in the petition is against the provisions of the CrPC and hence it is liable to be dismissed with cost.
The magistrate's order was challenged by advocates D K Mishra and Poonam Kaushik, seeking setting aside of the decision for an in-camera hearing and had alleged that the courtroom was crowded because of the presence of a large number of policemen.
In their application moved on behalf of "the concerned lawyers and the citizens of the country," the advocates had said, "Passing the order, the metropolitan magistrate has cast a number of apprehensions and allegations on lawyers and mediapersons assembled there, being the representatives of nation who have been hurt.
"The whole nation is interested in knowing the proceedings of the case. In-camera trial cannot be done at the stage of pre-trial. It could have been done after case is committed to sessions court."
The police had earlier filed an application for in-camera proceedings in the case before the magistrate under section 327 (2) and (3) of the CrPC.
The Delhi police had also issued an advisory on January 5, saying the proceedings in the case cannot be reported as the court has already taken cognisance of the charge sheet.
The magisterial court on January 5 had taken cognisance of the chargesheet against the five adult accused under sections 302 (murder), 307 (attempt to murder), 376 (2)(g) (gang-rape), 377 (unnatural offences), 395 (dacoity), 396 (murder in dacoity), 201 (destruction of evidence), 394 (hurting in dacoity), 120-B (conspiracy), 34(common intention) and 412 (dishonestly receiving stolen property) of the IPC.
The case of the sixth accused -- a minor -- is being heard by a Juvenile Justice Board.
The victim, a paramedical student, was raped and assaulted in a moving bus in New Delhi on the night of December 16 and died of her injuries on December 29 in multi-speciality Mount Elizabeth Hospital in Singapore.