To keep witnesses from influencing other witnesses, witnesses are kept out of the courtroom unless giving testimony. Prevents witnesses from discussing testimony with other witnesses before giving testimony. Rule of evidence.
Black’s Law Online Dictionary