It is illegal to discriminate against someone because they are married or in a civil partnership. A civil partnership has mostly the same legal rights in the workplace as a marriage.
Employers sometimes discriminate against people who are married or in a civil partnership for a number of reasons, including prejudicial misgivings about their commitment to work. Entities like the Citizen's Advice Bureau and The Equality and Human Rights Commission have more detailed guidance on the types of discrimination and the steps you can take if you feel you have been discriminated against.