How laws work:
For you:
Murder is illegal. I have no plans to murder anyone but if someone murders someone and I see it, if i call the authorities, the police will investigate and hopefully the person who did it will be convicted of murder and punished for it.
This is called an incentive.
Me: I'd like to kill Theo but it's not worth the prison time and I'll probably get caught and I don't want to go to prison, so the Theo lives!
This is called a deterrent.
Danny Rolling: I'd like to murder a bunch of girls and i don't care what the law says or what the punishment is.
This is why laws don't stop criminals.