ms. archana, - absolutely correct.
due to that reason, they ware black gown and coat..
I saw two types of pants they were, black and another is striped black.
i heard that black gown is compulsary for appearing before the court.
so far i understood, this dress code came as heritage from british rulers to us.
from supreme court to munsef court all these established at british time.
previously some more formalities were maintained which now not followed.
every place where discipline is prime considaretion, dress code is there, like police military etc.
it is not only your question many people asks this question, several times even in this web site also.
i also asked my hc adv the same question. he replied as adv archana wrote.