Sigmund Freud said this quote

In many criminals, especially youthful ones, it is possible to detect a very powerful sense of guilt which existed before the crime, and is therefore not its result but its motive. It is as if it was a relief to be able to fasten this unconscious sense of guilt on to something real and immediate.