There are a lot of people that feel that if their actions, or even their intentions, are questionable or not, doesn't matter so much, as long as the end result is beneficial for those others that are part of that act; signifying their belief in the apparent truth that the good ends justify the means of any sort. Unfortunately, civilizations and relationships have been built upon this false premise, for to believe that it's fundamentally right to do something that is foundationally immoral, as long as the end result is good, permits far too many people as well as civilizations the excuse that nothing is wrong, if the end result appears to be right.
In point of fact, to lie, to trick, and to coerce someone in a manner in which the objective is through this deception to get that other person to confess the truth, is an immoral act, even if the truth does come to light. It is immoral, because a deliberate act of deception is wrong, and a wrong in and of itself is still wrong, despite the supposed good intentions behind it. That is to say, if the quest is for the truth from a given person, there are legitimate ways to get to that truth, and if such truth does not come to fruition from that person, than in those circumstances, the truth must be discerned, or set aside.
A moral act, in all circumstances must be a good act; so that, if an act is bad, it cannot and is not ever a moral act. Further, a moral act is not just a good act on its surface, though that is foundationally part of a moral act, but a moral act must also be in order to be moral, be done for the right reason as well as in the right way. These means that a moral act consists in the synchrony of it being a good act, for the right reason, and done in the right way.
The reason why a correct moral act, contains these three elements, is for example, there are people that are selective about telling the truth, but, when the purposes so satisfy them, they testify to that truth, but the reason behind doing so, could be so as to get someone else in trouble, or to create embarrassment for that person, of which by "telling the truth," they are able to hide behind this wall, as being the justification of what they have done. But what they have really done is to start with an element of a moral act, but they have done so for the wrong reason, and in the wrong way.
It isn't good enough to be telling the truth, when inside that person knows that they are disclosing the truth for purposes unbecoming. Instead, before we communicate with others, and perform acts throughout our day, we should understand the purpose behind such, and if that purpose isn't right, or isn't performed in the right way and for the right reason, then it isn't going to be a good moral act. In order for a moral act to be good, it must be for the right reason, and done in the right way, and all those that adhere to such, are performing moral acts of real goodness, and having done so, are good, themselves.