Wanting to know the sex of a child and being desperate about gender is an understandable issue for parents. After all, it may be that after, say, six daughters, a son would be nice (do we still have sons just to carry on the family name? Well, the Crown does it - heir and a spare, and all that...).
Is it important to be able to have a baby of the 'right' sex? Yes, of course it is, and speaking as someone with one of each, it is easy for me and very convenient to have cracked the baby sex lottery in two, as it were. I can understand the issue for parents with larger families where they do honestly and desperately want to have at least one child of each sex. Those desires are based on personal reasons and one can be sympathetic about their perception of perfect family life - we would all want it if we thought about it.
Further - there may be medical reasons for wanting a child of a particular sex - inheritance of blood disorders, for example, and, of course, the heavy area of 'saviour siblings'.
Now - what of other issues linked to this choice of baby's sex? If we permit sex-choice in respect of personal preference reasons what rationale do we have for not selecting how we grow our family based on other criteria - inherited disorders based on the sex of the baby, or 'saviour siblings' aside? Rationally there can be little reason for not selecting out on hosts of other factors, the front-runners being intelligence, looks, eye colour, then we go on to selecting genetically on future health issues, earning capacity (why not?) and then we have the problem of what to do with the rejects. This is the medical side of family law, but it affects more than merely the subject of the law itself - we need to be careful that the next box we open isn't Pandora's. Once opened, it might be difficult to shut.
I have never believed that it was a sound reason to do something to have the rationale based on just because we can... in this instance I think we need to think very carefully first.