Officials from the Department of Justice appeared in court yesterday to argue that discrimination against gay employees is legal.