This is not an open question. The Magisterium has a definitive teaching on lying:
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.
2485 By its very nature, lying is to be condemned.
The Magisterium teaches that lying is intrinsically evil. Pope John Paul II in Veritatis Splendor teaches that intrinsically evil acts are always immoral, regardless of intention or circumstances.
If acts are intrinsically evil, a good intention or particular circumstances can diminish their evil, but they cannot remove it. They remain “irremediably” evil acts; per se and in themselves they are not capable of being ordered to God and to the good of the person. “As for acts which are themselves sins (cum iam opera ipsa peccata sunt), Saint Augustine writes, like theft, fornication, blasphemy, who would dare affirm that, by doing them for good motives (causis bonis), they would no longer be sins, or, what is even more absurd, that they would be sins that are justified?”. Consequently, circumstances or intentions can never transform an act intrinsically evil by virtue of its object into an act “subjectively” good or defensible as a choice. (Veritatis Splendor, n. 81)
There is a common false teaching on lying, which is spreading among the faithful by means of the internet, that deliberately asserting a falsehood is not a lie unless one also intends to deceive. Not so.
According to the infallible teaching of the ordinary and universal Magisterium, every knowingly chosen act with an evil moral object is intrinsically evil and always immoral, regardless of intention or circumstances. This teaching is found in Veritatis Splendor, the CCC, the Compendium, the USCCB Catechism, and is applied to many different moral questions in innumerable magisterial documents. Whoever denies this teaching, commits the sin of heresy.
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.
1756 It is therefore an error to judge the morality of human acts by considering only the intention that inspires them or the circumstances (environment, social pressure, duress or emergency, etc.) which supply their context. There are acts which, in and of themselves, independently of circumstances and intentions, are always gravely illicit by reason of their object; such as blasphemy and perjury, murder and adultery. One may not do evil so that good may result from it.
Anyone who claims that an intrinsically evil act becomes moral, or becomes no longer intrinsically evil, by a change in intention, or by a change in circumstances, or by a change in both, thereby rejects the infallible teaching of the ordinary and universal Magisterium on intrinsically evil acts. What makes an intrinsically evil act immoral is its object (also called moral object) — the proximate end, in terms of morality, toward which the knowingly chosen act is inherently directed (i.e. intrinsically ordered). The deliberate choice of an inherently disordered act is always immoral because the act is wrong by its very nature, in and of itself, apart from intention or circumstances.
So then, why does the CCC sometimes include intention or circumstances when defining certain sins? The answer is simple and clear. Every knowingly chosen act has three fonts (sources) of morality:
The intended end, the purpose or reason for choosing the act. The intention resides in the subject, the person who acts.
2. moral object
The proximate end, in terms of morality, toward which the deliberately chosen act is inherently ordered.
The totality of the foreseeable consequences of that act for all persons concerned.
So there is nothing wrong with describing the usual intention or a typical circumstance that accompanies some particular type of intrinsically evil act. Every intrinsically evil act has an intention, and an evil moral object, and circumstances. Lying is typically done with the intention to deceive someone. But it is still immoral, due to the moral object, even if the person telling the lie has a good intention, and does not intend to deceive, and even if the circumstances are dire.
Now some intrinsically evil acts are defined by reference to both the evil moral object and an intention or circumstance. For example:
Euthanasia is essentially murder with the intention of eliminating all suffering. But if the same act is committed with a different intention, such as to save a hospital money or to gain an inheritance, it is no longer euthanasia. But it remains a type of murder; the act remains intrinsically evil. For the evil moral object has not changed.
Abortion is essentially murder in the circumstance that the person being killed is prenatal. But if the same type of act is committed after the child is born, the act remains murder, even though now it is no longer defined as abortion. As long as the moral object does not change, an intrinsically evil act remains intrinsically evil. Each and every intrinsically evil act remains immoral, regardless of the intention or the circumstances, as long as the moral object remains the same.
The first version of the CCC defined lying incorrectly:
2483 To lie is to speak or act against the truth in order to lead into error someone who has the right to know the truth.
2508 Lying consists in saying what is false with the intention of deceiving the neighbor who has the right to the truth.
In the second edition of the CCC, this error was corrected to:
2483 To lie is to speak or act against the truth in order to lead someone into error.
2508 Lying consists in saying what is false with the intention of deceiving one’s neighbor.
However, this does not imply that speaking or acting against the truth is only a lie (or is only immoral) if one also intends to deceive or lead into error. Lying is usually done in order to deceive someone. Every knowingly chosen act has an intention, as well as a moral object, and circumstances. Stating the usual intention that typically accompanies an intrinsically evil act does not imply that the act becomes moral with a different intention. For example, masturbation is typically done “in order to derive sexual pleasure” (CCC 2352). But it is still immoral if it is done for some other intention, such as to obtain a sample for medical analysis. Intrinsically evil acts are always immoral, regardless of intention or circumstances.
Moreover, the CCC does NOT say that speaking or acting against the truth is moral with a good intention — as many online commentators are claiming. In fact, the teaching of the CCC makes it clear that such is not the case:
1759 “An evil action cannot be justified by reference to a good intention” (cf St. Thomas Aquinas, Dec. praec. 6). The end does not justify the means.
1760 A morally good act requires the goodness of its object, of its end, and of its circumstances together.
1761 There are concrete acts that it is always wrong to choose, because their choice entails a disorder of the will, i.e., a moral evil. One may not do evil so that good may result from it.
No matter what the intention, every intrinsically evil act is immoral in and of itself, by the very nature of the act, and so it cannot be justified by any intention. It is always a sin to deliberately and knowingly choose an inherently immoral act, such as lying.
Now some persons claim that Saint Augustine defined lying as necessarily including the intention to deceive. First, this is not true. As I explain at length here, Saint Augustine said that people cannot agree if lying is still immoral (or is still lying) if there is no intention to deceive. However, he also says that one should not lie, even without the intention to deceive (‘On Lying’, last sentence n. 4). Second, the opinion of a Saint and Doctor of the Church is not in itself a dogma. We cannot ignore hundreds of years of teaching by the Magisterium, subsequent to the opinion of any Saint, for no Saint is above the Magisterium.
And in fact the Magisterium has clarified its teaching on lying and on what makes any act immoral, since the time of Augustine.
In order to be moral, each and every knowingly chosen act must have three food fonts:
1. only good in the intention; any evil in the intention makes the act a sin
2. only good in the moral object; any evil in the moral object makes the act a sin
3. the reasonably anticipated bad consequences must not morally outweigh the reasonably anticipated good consequences
Therefore, if the moral object is evil, the act cannot be justified by a good intention, nor by dire circumstances.
I’ve covered this topic extensively in previous posts:
Is Lying Always Wrong? — part 1: intrinsic evil
Is Lying Always Wrong? — part 2: the definition of lying
Is Lying Always Wrong? — part 3: Saint Augustine
Is Lying Always Wrong? part 4: deliberate choice
The Distinction between Lying and Mental Reservation
When is lying a mortal sin?
An error in the definition of lying
Why is the morality of lying important?
On lying, intrinsic evil, and moral intuition (reply to Peter Kreeft)
What does Sacred Scripture say about the morality of lying?
God is Truth. For this reason, speaking or acting against the truth is intrinsically evil and always immoral, regardless of intention or circumstances.