Lawyers and judges are in the profession that serves in the judiciary of the country.
Lawyers do not wear black coat for fashion in fact the advocacy was started by Edward in the year 1327 and suddenly the dress of lawyers was decided. But that was not a black coat. The dress was a like a red clothes with brown colored gown. And judges used to wear long haired wig on their heads and lawyers were divided into four categories that were : Seargents, Pleaders, Benchers and Barristers.
In the year 1600, the dress code for the lawyers was decided by Bar Council and then the long black coats were decided as their uniform. It was considered that a long black coat is a identity of their profession and that makes the lawyers different from others.
The king willians had ordered all the judges and lawyers to wear black coats on the death of her daughter "Queen Marry" in the year 1694. And that order was not declined and is followed till now.
From the year 1961, an advocate act was formed according to which, It was made compulsory for judges and lawyers to wear long black coats along with white shirt and white tie. This dress code was made for lawyers to maintain the discipline.
Can you now answer why doctors wear white coat ?