用你的例子:He's campaigning with illegal funds on the theory that if he wins the election the end will justify the means。
Winning the election is the goal. There could be other, unintended consequences, but he is hoping his wrongdoing be justified by winning the election (which is his goal), not by other unintended consequences.