Intention is divisible into immediate and ulterior intent. A crime is seldom committed for its own sake. There is the ulterior object in the commission of the crime.
When a robber robs a person his immediate intention is to rob him, but the ultimate or ulterior intent is to purchase food or wine for himself. The ulterior object is called motive, while the immediate act is intention. As a general rule a man’s motive is irrelevant in determining the question of criminal liability. No act otherwise lawful becomes unlawful because it has been done with a bad motive and conversely an act otherwise unlawful cannot be excused because of the good motives of the doer of the act. The law, therefore, takes into account the primary or immediate intention and not the ulterior, remote or secondary.
The law does not concern with motive, which may be good, bad or indifferent. End cannot justify the means and so the motive cannot justify the intention. Thus, where a few Hindus acting in concert and under the influence of religions feeling forcibly removed an ox or two cows from the possession of a Mohammedan, not for the purpose of causing wrongful gain to themselves or wrongful loss to the owner of the cattle, it was held that they were guilty of an offence of rioting under Section 146, 1.P.C., however, laudable and virtuous their object might be from the view point of their own religion.
[Emperor v. Ranghunath Rai, (1892) 15 All. 22], Hence good motive is no defence to criminal proceedings when the intention of the person is criminal.