Home Affairs has denied my application to change my surname to my spouse as I am in a same-sex marriage, and . Is this legal ?

Home Affairs has denied my application to change my surname to my spouse as I am in a same-sex marriage, and . Is this legal ?
The short answer
Home Affairs is wrong, but it is complicated.
The whole question
I am a South African citizen living in the USA. I got married (same-sex marriage) in 2019 and applied for a new passport reflecting my new name change (surname) on the passport in 2024.
I received confirmation from Home Affairs that they have now refused to change my name because they do not recognize same sex marriages and name changes are not allowed on the passport. Below is the correspondence from them:
"Please note that we have received verification of the status of your passport:
Your passport application was received by DHA on the 12 July 2024
On the 10 August 2024  your application was moved to the Citizenship for verification of SA Citizenship.
Next your application was moved to the Marriage Section to confirm your marital status.
According to the DHA, with regards to same sex civil unions name changes are not permitted, thus all parties concerned will keep their last name. ie: Jason Roelof Saunders will remain Jason Roelof Saunders and not Turner.
Thereafter  your passport will be moved for capturing and processing and will take another 6-8 Months."
Is this allowed? I feel that this is some sort of discrimination, as I have many women friends from South Africa who got married and changed their names to match their husbands with no issue. I would not care if it were not for my line of work. I am an airline pilot and am having many issues when travelling to different countries because my passport and green card documents all have mismatched names. It is now directly affecting my job.
The long answer
Thank you for your email asking if Home Affairs can declare that you may not change your surname to your partner’s on your passport because “with regard to same sex civil unions, name changes are not permitted.”
This is most certainly wrong: in South Africa both partners/spouses in a civil union partnership are allowed to choose what surnames they will be known by. Section 13 of the Civil Union Act explicitly gives spouses/partners this choice.
The Civil Union Act does not make any explicit provisions to recognise foreign same-sex unions, but under the common-law definition of marriage, a foreign same-sex marriage is recognised as a marriage in South African law.
“Couples who marry in terms of the Civil Union Act may choose whether their union is registered as a marriage or a civil partnership. In either case, the legal consequences are identical to those of a marriage under the Marriage Act, except for such changes as are required by the context. Any reference to marriage in any law, including the common law, is deemed to include a marriage or civil partnership in terms of the Civil Union Act; similarly, any reference to husband, wife or spouse in any law is deemed to include a reference to a spouse or civil partner in terms of the Civil Union Act.” (Wikipedia).
But the problem is that there are contradictions between Section 26 (1) of the Births and Deaths Registration Act and the Civil Union Act: on the DHA website it states that “Passports are issued in accordance with your names as they appear in the National Population Register (NPR) at the time of your application. Any changes to your names must be applied for, finalised and recorded in the NPR before you submit your passport application.”
It seems that it costs R375 to apply for a change of name to the NPR.
A Rhodes University thesis by LLB student Chris McConnechie notes that section 26(1) of the Births and Deaths Registration Act says that no individual may describe himself by any other name than the one recorded in the NPR without permission of the Director General of Home Affairs – except that women can change their surnames upon marriage without applying for permission. In a marriage as opposed to a civil union, a man cannot change his surname without permission while a woman can; in a civil union both partners are able to change their surnames.
As you know, all discrimination on the basis of sexual orientation and against same sex couples is outlawed by Section 9 of the Constitution and by the Promotion of Equality and Prevention of Unfair Discrimination Act. But given the difficulties, delays and frustrations routinely experienced by people when dealing with Home Affairs, it may be quicker and easier in the short term to apply to the Director General of Home Affairs for permission to change your surname, and then to re-apply for your passport.