Interesting.
From a Catholic perspective (so if you’re not Catholic this may not interest you) anything but the “marital act” is considered immoral and hence unacceptable.
So, for example, if a couple thinks one may be infertile, fertility tests are prohibited (at least for a man) as it necessitates sexual stimulation outside the marital act.
However I do know that there is one fertility test permitted, which uses a condom to collect the sperm during the act (the condom is perforated so as to not be a barrier to conception itself) and then the collected sperm is tested.
So maybe the procedure you detail above might be permissible in Catholicism, using the same technique described above to collect the sperm.
I doubt it though as the Church is pretty adimate about the marital act being the only way the generation of new life may occur licitly. In fact I may be wrong about the “approved” fertility test I described above. (I don’t think I am though).
So I conclude as I started by saying, “Interesting”.
According to http://www.usccb.org/issues-and-action/marriage-and-family/natural-family-planning/resources/upload/Reproductive-Technology-Evaluation-Treatment-of-Infertility-Guidelines-for-Catholic-Couples.pdf it is not in accordance with Catholic teaching except under circumstances you mentioned. No mention in the article about relative gravity of the sins of IUI vs IVF which I would expect to be quite disparate. If you find something ping me.