The relation between morality and law is (or ought to be) complex and subtle: the two are neither identical nor entirely separate. Once upon a time everyone seemed to understand this, as if by instinct; but the instinct, if it ever existed, has been lost. When someone says, by way of excuse for his bad behavior, that “There’s no law against it,” he implies that what is not legally forbidden is permissible in every other sense.
No one, incidentally, ever explained his good behavior by reference to this legal/illegal boundary. The misunderstanding is a motivated one.
A misunderstanding of the morality of punishment and its justification in law will not always be grounded in self-interest, however. We can see this from a brief column recently published in the Guardian by the philosopher Nigel Warburton. Warburton considered the case of a man called John Paul Burrows, a multimillionaire who worked in the City of London as the director of a very large investment company.