My wife and I have thought about this frequently considering that we have three boys and really would like to have a girl. For us it is more of an adoption question. We really want to adopt and we really would like a girl. Is choosing to adopt to get a desired gender wrong, even if our intentions are good? What if you adopt 60% because you can select the gender and 40% for the right reasons. Knowing that we have these personal questions, a close friend recently asked us if we knew the Church's official position and what our personal opinion was on the matter.
I'm familiar with the church's position on most matters for two reasons. The first comes from reading the Church's General Handbook of Instructions a couple of times. During bishopric meetings every Sunday during dental school (I was ward clerk) we would go through a section of the handbook to make sure we were aware of the proper methods of carrying out church activities. Secondly, as part of our biology major in undergrad at BYU Marisa and I had a class called bio-ethics. We went over the major ethical issues involved with biology from genetically modified food to euthanasia (yes, the children in Asia are doing fine!). Because it was a class at BYU we also were fortunate to receive the Church's official position where it had one. I loved this class because we had group sessions where we would decide what was the most ethical thing to do, both for the general public and ourselves as Mormons. There were very interesting times when these two didn't coincide.
I don't remember anything specific from that class on artificial insemination. So I did a Google search. Although you can't blatantly copy (hard or electronic) the handbook, it is ok to have sections copied and given to people for clarification. In that spirit I avoided looking for the handbook online, but don't mind copying a section found on a webpage that shows our policy towards a couple difficult issues such as this:
Artificial insemination is defined as placing semen into the uterus or oviduct by artificial rather than natural means. The Church does not approve of artificial insemination of single women. It also discourages artificial insemination of married women using semen from anyone but the husband. "However, this is a personal matter that ultimately must be left to the husband and wife, with the responsibility for the decision resting solely upon them" (_General Handbook of Instructions,_ 11-4). Children conceived by artificial insemination have the same family ties as children who are conceived naturally. The _General Handbook of Instructions_ (1989) states: "A child conceived by artificial insemination and born after the parents are sealed in the temple is born in the covenant. A child conceived by artificial insemination before the parents are sealed may be sealed to them after they are sealed."That all seems pretty benign and doesn't tackle this issue of gender selection. I couldn't find anything specific to this issue from the church so if you do, please make a comment. My personal opinion on many things that happen in this life is that we get to choose and then we suffer/enjoy the consequences. This life isn't totally mapped out. I don't think that all people were preordained to be in the exact family that they ended up in. If a 16 year old girl chooses to give in to her boyfriend's wishes and gets pregnant then that spirit will end up with her as the mother. If she chooses to wait until later in her life when she is married to a different man than her previous boyfriend then that spirit will probably have headed to another family. The family the spirit goes to isn't 100% random either. Kind of like a happy medium between the two possible ends of the spectrum. If this is the case, then choosing your child's gender (and how many children you have for that matter) doesn't break down the perfect cosmic tapestry pre-woven in the life before this.
The similar subject of how many children to have can potentially help give perspective on this issue. There are probably many times when a family wasn't "supposed to" have another child, ie-some spirit waiting up in heaven for just this family. They end up getting pregnant. This then gives them the consequence and the joy of getting another spirit in their family. Choosing to (intentionally or not) have another child is totally up to them. So, I guess you can tell which way I lean on the main subject at hand, but I have to admit...I'm not totally comfortable one way or the other. If it came down to actually having the opportunity/necessity to make this decision I would have to go with the standard practice and one recommended in the handbook, together with your spouse take the question up with the Lord. When you get an answer from him you know you are in the right. The tough thing there is what to do when you don't get the 100% obvious answer...