The issue is here and is usually with this sort of topic is it's confusing two things:
Gender - sexual orientation
Sex - biological
On your birth certificate you do not put gender as that would make no sense. It uses the words Male and Female based on the biological evidence of if the child has male reproductive organs, female productive organs, both or none.
Having undecided as Sex (or written as gender sometimes which is where the confusion comes in) makes genuinely no sense on a birth certificate. For instance someone may grow up and discover that they like the same sex, or they want to transition to the other sex and people should have the right once they transition to update their official documentation to show that, but they were not "undefined" when they were born.