The words of Christ here are simple in teaching, but sometimes exceedingly difficult to live and practice. In the context of Matthew 5, this quote comes at the conclusion on Jesus’ brief discourse regarding swearing oaths.
Jesus forbids oath swearing for private purposes. Oaths are important, however, in the public sector for the good of society. […] In Jesus’ day, the practice of oath swearing was sometimes mishandled; people would swear private oaths for personal advantage. By invoking something other than God’s name (heaven / earth / Jerusalem; 5:34-35), oaths were taken lightly or even disregarded (23:16-22). Jesus denounces this, teaching that truthfulness and integrity should govern private life.—Scott Hahn & Curtis Mitch, The Ignatius Catholic Study Bible New Testament
The morality of lying is clear for most cases, but in certain situations it can be pretty sticky. Catholic Answers has a nice—albeit dense, at least to my brain— article on the morality of lying by Rev Thomas Slater SJ. I’ll include the highlights here, though feel free to check out the full article. I’d just suggest taking it somewhere quiet where you can focus for 30 minutes or so because it’s not exactly casual, “fluffy” reading!
Lying, as defined by St. Thomas Aquinas, is a statement at variance with the mind. […] Following St. Augustine and St. Thomas, Catholic divines and ethical writers commonly make a distinction between (1) injurious, or hurtful, (2) officious, and (3) jocose lies.
- An injurious lie is one which does harm.
- An officious, or white, lie is such that it does nobody any injury: it is a lie of excuse, or a lie told to benefit somebody.
- Jocose lies are told for the purpose of affording amusement. Of course what is said merely and obviously in joke cannot be a lie: in order to have any malice in it, what is said must be naturally capable of deceiving others and must be said with the intention of saying what is false.
If a man is hid in your house, and his life is sought by murderers, and they come and ask you whether he is in the house, [St. Augustine holds that] you may say that you know where he is, but will not tell: you may not deny that he is there. The Scholastics, while accepting the teaching of St. Augustine on the absolute and intrinsic malice of a lie, modified his teaching on the point which we are discussing. [St. Raymund of Pennafort] says that most doctors agree with St. Augustine, but that others say that one should tell a lie in such cases. Then he gives his own opinion, speaking with hesitation and under correction. The owner of the house where the man lies concealed, on being asked whether he is there, should as far as possible say nothing. If silence would be equivalent to betrayal of the secret, then he should turn the question aside by asking another—How should I know?—or something of that sort. Or, says St. Raymund, he may make use of an expression with a double meaning, an equivocation […]. An infinite number of examples induced him to permit such equivocations, he says. Jacob, Esau, Abraham, Jehu, and the Archangel Raphael made use of them. Or, he adds, you may say simply that the owner of the house ought to deny that the man is there, and, if his conscience tells him that this is the proper answer to give, then he will not go against his conscience, and so he will not sin. Nor is this direction contrary to what Augustine teaches, for if he gives that answer he will not lie, for he will not speak against his mind.
The common teaching of the schools at the time, adopts the opinion of St. Raymund, with the added reason that it is allowable to deceive an enemy [but] warns the student that a witness who is bound to speak the naked truth may not use equivocation.
The virtue of truth requires that, unless there is some special reason to the contrary, one who speaks to another should speak frankly and openly, in such a way that he will be understood by the person addressed. It is not lawful to use mental reservations without good reason. According to the common teaching of St. Thomas and other divines, the hurtful lie is a mortal sin, but merely officious and jocose lies are of their own nature venial.
—Rev Thomas Slater SJ, Lying: Treatment of the moral concept (CatholicAnswers.com)