It is the matter of a human act. The next time we have something to consider we first have to look at the action itself. If it is, in itself, something that is immoral then under no circumstances or even with the best of intentions can I choose to do it. The Church teaches us these truths so they we can save our time for considering even better things to do in our lives. Wasting our time deliberating actions that will only harm us is no way to live a life rooted in Christ.
Intention is an essential part of all human action.
Because we are sinful, we might have right next to a good intention an equally evil one which robs us of the goodness of the action. The Lord gives us the Season of Lent each year to purify our intentions. Now that we have completed this past Lent, may we continue to offer Him all of our penances and all of our intentions. He was providing for his family the best way he could. This means that the action chosen has to be a good one in and of itself.