Can an employer be liable for harassment by its employees of another employee because they are gay?

Yes, under the Equality Act 2010, an employer will be liable for harassment by its employees in the course of their employment even if it was unaware of it at the time, unless the employer has taken all reasonable steps to prevent the employees from harassing others. At a minimum, to have a successful reasonable steps defence, an employer is likely to have to have a policy in place dealing with harassment related to sexual orientation and to have taken effective measures to ensure that employees are aware of, and understand, the policy. This is likely to require some training of employees.