Well, when voters see that her husband has the same last name, it becomes pretty obvious she changed her name at marriage.
The law was passed in 1995, before anyone knew what a deadname was. And I do not see it as sexist, especially when the only reason women change names more than men is specifically excluded.
Just because it’s public record (and even then sometimes you can get records sealed) does not mean the information is easily accessible.