It's a relic of the 17th century. At one time all 'Lords. Ladies and Gentlemen' wore wigs. This allowed, in the case of ladies, the wearing of fanciful hair creations which would have been impossible if restricted to the wearer's natural hair. In the case of the men this also had something to do with fashion but also permitted a certain hierarchy to be indicated by the size and length of the wig. White wigs were immediately "aging" and conferred on the wearer (it was felt) an impression of wisdom. As a result both Judges and barristers wear white wigs, the judge's model being considerably longer. Wigs may be left off at the judge's discretion. Wigs were at one time worn by clergymen as well but the practice was dropped a long time ago.