Laws create structure and stability within a group. You are correct Laws don't stop criminals, but just as in pre-recorded history, if you broke the rules binding a tribe together you were ostrcized from that group and no longer had its protection or resources.
While criminals will create problems due to not following Law, most people in the group will thus creating a stable environment for the group to flourish. This is ofcourse assuming the laws are just and freely accepted by all.