In an old webpage about The sense of Morality according to the Knights Templar, what was very insightful was that "Intentionality" was the base of all action, thought, or feeling. If your intentions aren't sincere, the consequences are of your own doing.

1° The consequences of an action, whatever they are, don't render them neither good nor bad morally: Intention is all. To speak rigourosly, there are no moral action, there are only Moral Intentions.

2° For an action to be good morally, it must not come out of interest.

3° Are considered as interested, all intentions where there's a personal return. As so, doing something in order to gain honours, glory, applauds, pleasures, whether sensuals, intellectuals, external pleasures or internal pleasures, to hear that one is generous or to be able to say it to oneself, to have rewards on the earth or even in heaven, all this is also outside of morality.

4° Are regarded as morally indifferent: actions, even the most useful, which come from the impulse of the organization.

5° Is regarded only as virtuous a being who, having weighed an action, and found it just, makes it only, because he believes that it must be done, and for that reason alone, that it's Just.