In Gurbani it is written that everything that happens is God's hukam.so if a person does something bad to another person then why we get punised.i mean he can't do it if god didn't want it to happen.In short if everything that happens is god's will then why we are to be punished.