tl;dr> The Church opposes in vitro fertilisation, but not because it is humanity playing at being God.
The first port of call in determining what the Catholic Church teaches is always the Catechism. If question can be answered by fundamental principles, the answer is likely to be found there. So: first it's necessary to examine the fundamental principles.
The Catechism states
1753 A good intention (for example, that of helping one's neighbor) does not make behavior that is intrinsically disordered, such as lying and calumny, good or just. the end does not justify the means. Thus the condemnation of an innocent person cannot be justified as a legitimate means of saving the nation. On the other hand, an added bad intention (such as vainglory) makes an act evil that, in and of itself, can be good (such as almsgiving).39
1754 The circumstances, including the consequences, are secondary elements of a moral act. They contribute to increasing or diminishing the moral goodness or evil of human acts (for example, the amount of a theft). They can also diminish or increase the agent's responsibility (such as acting out of a fear of death). Circumstances of themselves cannot change the moral quality of acts themselves; they can make neither good nor right an action that is in itself evil.
1755 A morally good act requires the goodness of the object, of the end, and of the circumstances together. An evil end corrupts the action, even if the object is good in itself (such as praying and fasting "in order to be seen by men").
The object of the choice can by itself vitiate an act in its entirety. There are some concrete acts - such as fornication - that it is always wrong to choose, because choosing them entails a disorder of the will, that is, a moral evil.
Even though the creation of life is good, it cannot justify a sinful method.
Is in vitro fertilisation a sin?
1852 There are a great many kinds of sins. Scripture provides several lists of them. the Letter to the Galatians contrasts the works of the flesh with the fruit of the Spirit: "Now the works of the flesh are plain: fornication, impurity, licentiousness, idolatry, sorcery, enmity, strife, jealousy, anger, selfishness, dissension, factions, envy, drunkenness, carousing, and the like. I warn you, as I warned you before, that those who do such things shall not inherit the Kingdom of God."127
1849 Sin is an offense against reason, truth, and right conscience; it is failure in genuine love for God and neighbor caused by a perverse attachment to certain goods. It wounds the nature of man and injures human solidarity. It has been defined as "an utterance, a deed, or a desire contrary to the eternal law."121
Is in vitro fertilisation contrary to the eternal law?
Eternal law is “the source — in God — of all law”. It finds its expression in what is called moral law.
1952 There are different expressions of the moral law, all of them interrelated: eternal law - the source, in God, of all law; natural law; revealed law, comprising the Old Law and the New Law, or Law of the Gospel; finally, civil and ecclesiastical laws.
In vitro fertilisation is obviously an intervention designed to overcome what is seen to be a defect — the inability to conceive naturally. But this condition is part of God's plan.
1936 On coming into the world, man is not equipped with everything he needs for developing his bodily and spiritual life. He needs others. Differences appear tied to age, physical abilities, intellectual or moral aptitudes, the benefits derived from social commerce, and the distribution of wealth.41 The "talents" are not distributed equally.42
1937 These differences belong to God's plan, who wills that each receive what he needs from others, and that those endowed with particular "talents" share the benefits with those who need them. These differences encourage and often oblige persons to practice generosity, kindness, and sharing of goods; they foster the mutual enrichment of cultures:
I distribute the virtues quite diversely; I do not give all of them to each person, but some to one, some to others.... I shall give principally charity to one; justice to another; humility to this one, a living faith to that one.... and so I have given many gifts and graces, both spiritual and temporal, with such diversity that I have not given everything to one single person, so that you may be constrained to practice charity towards one another.... I have willed that one should need another and that all should be my ministers in distributing the graces and gifts they have received from me.43
The ability to create life in vitro may also be seen as a talent not given to everyone, to be shared with those who need it.
So: both infertility and the ability to counter it appear to be God-given. The one is the result of Original Sin whereby imperfection entered the world, and which it is part of the human condition to bear. The other may be given for temporal alleviation prior to eternal bliss where there shall be neither tears nor cryingA; or it too is sinful because it counters God's plan.
Well done for reading this far; unfortunately in vitro fertilisation appears to fall between two fundamental principles.
The Congregation for the Doctrine of the Faith has recognised this dichotomy in an Instruction:
These interventions are not to be rejected on the grounds that they are artificial. As such, they bear witness to the possibilities of the art of medicine. But they must be given a moral evaluation in reference to the dignity of the human person, who is called to realize his vocation from God to the gift of love and the gift of life.
From the time that the ovum is fertilized, a new life is begun which is neither that of the father nor of the mother; it is rather the life of a new human being with his own growth. It would never be made human if it were not human already. To this perpetual evidence ... modern genetic science brings valuable confirmation. It has demonstrated that, from the first instant, the programme is fixed as to what this living being will be: a man, this individual-man with his characteristic aspects already well determined. Right from fertilization is begun the adventure of a human life, and each of its great capacities requires time ... to find its place and to be in a position to act.25
The artificial creation of life is not inherently wrong. But
Conception in vitro is the result of the technical action which presides over fertilization. Such fertilization is neither in fact achieved nor positively willed as the expression and fruit of a specific act of the conjugal union. In homologous IVF and ETB, therefore, even if it is considered in the context of 'de facto' existing sexual relations, the generation of the human person is objectively deprived of its proper perfection: namely, that of being the result and fruit of a conjugal act in which the spouses can become "cooperators with God for giving life to a new person".50
The way in which artificial fertilisation and the methods associated with in vitro creation of life can be and are inherently wrong. The expression of sperm is generally outside the conjugal act and “is another sign of this dissociation [between the unitive act of love and the act of procreation]: even when it is done for the purpose of procreation, the act remains deprived of its unitive meaning: ‘It lacks the sexual relationship called for by the moral order, namely the relationship which realizes “the full sense of mutual self-giving and human procreation in the context of true love”’.54”
A procedure included in most implementations of IVF is the disposal of surplus embryos. That is, once life is created in the zygote with the fertilisation, any which are “not required” are destroyed.
... every child which comes into the world must in any case be accepted as a living gift of the divine Goodness and must be brought up with love.
To destroy life is repugnant to the Church.
All the while it is impossible to unite the methods of IVF with conjugal union,
... in conformity with the traditional doctrine relating to the goods of marriage and the dignity of the person, the Church remain opposed from the moral point of view to homologous in vitro fertilization. Such fertilization is in itself illicit and in opposition to the dignity of procreation and of the conjugal union, even when everything is done to avoid the death of the human embryo.
25 CDF Declaration on Procured Abortion, 12-13: AAS 66 (1974) 738.
39 Cf Matt 6:24
41 Cf Gaudium et Spes 29 # 2.
42 Cf Matt 25:14–30; Luke 19:27
43 S Catherine of Siena, Dial. I, 7.
50 Pope John Paul II, Apostolic Exhortation Familiaris Consortio. 14: AAS 74 (1982) 96.
54 CDF Declaration on Certain Questions Concerning Sexual ethics, 9: AAS 68 (1976) 86: Gaudium et Spes, 51. Cf. Decree of the Holy Office, 2 August 1929: AAS 21 (1929) 490; Pope Pius XII, Discourse to those taking part in the 26th Congress of the Italian Society of Urology, 8 October 1953: AAS 45 (1953) 678.
121 S Augustine, Contra Faustum 22: PL 42, 418; S Thomas Aquinas, Summa Theologica I-II, 71, 6
127 Gal 5:19-21 CE; Rom 1:28-32; 1 Cor 9-10; Eph 5:3-5; Col 3:5-8; 1 Tim 9-10; 2 Tim 2-5.
A Cf Rev 21:4
B Homologous (between husband and wife) in vitro fertilisation and embryo transfer