Most of us know the saying that the road to hell is paved with good intentions. We also know that the Buddha proclaimed kamma is intention, and when our consequences of our actions ripe and are reaped by us we basically reap the fruit of our own intentions. So, if we only think about cheating on our partner, we will still be punished by the Universe for it.
This is why I had this question: what if we do something unethical having wholesome intentions or something ethical having wholesome intentions? For example, when we steal a kilogram of apples from an apple plantation to feed a hungry person, kill someone to protect other people, or save a Thai girl from poverty and hunger by paying her for sex. Sure, one can argue that we cause suffering with our actions, but kamma is intention, so how come we are punished or rewarded for intentions that either do not exist or are wholly unconscious?
I think it is very possible that thinking along these lines was one of the sources of the Theravadin Abhidhamma with its minute classification of mental states. I also am not personally interested in the Abhidhamma or anything that can possibly lead to Abhidhamma-like results. This is why I would like to ask you not to answer these questions of mine with personal speculation but rather give a link to a discourse by the Buddha on the matter or something closely related to this topic.