From Pope St. John Paul II’s encyclical Veritatis Splendor (1993):
Furthermore, an intention is good when it has as its aim the true good of the person in view of his ultimate end. But acts whose object is “not capable of being ordered” to God and “unworthy of the human person” are always and in every case in conflict with that good. Consequently, respect for norms which prohibit such acts and oblige semper et pro semper, that is, without any exception, not only does not inhibit a good intention, but actually represents its basic expression.
The doctrine of the object as a source of morality represents an authentic explication of the Biblical morality of the Covenant and of the commandments, of charity and of the virtues. The moral quality of human acting is dependent on this fidelity to the commandments, as an expression of obedience and of love. For this reason — we repeat — the opinion must be rejected as erroneous which maintains that it is impossible to qualify as morally evil according to its species the deliberate choice of certain kinds of behaviour or specific acts, without taking into account the intention for which the choice was made or the totality of the foreseeable consequences of that act for all persons concerned. Without the rational determination of the morality of human actingas stated above, it would be impossible to affirm the existence of an “objective moral order”135 and to establish any particular norm the content of which would be binding without exception. This would be to the detriment of human fraternity and the truth about the good, and would be injurious to ecclesial communion as well.
135 Second Vatican Ecumenical Council, Declaration on Religious Freedom Dignitatis Humanæ, 7.
— Veritatis Splendor 82