Hello!
Answer:
It really depends on what the rules are. For example, if they are rules in your parent's house, then it's to teach you responsibility and what to do and what not to do. If it's for class rules, it would be partly to make the students feel safe as well as to show respect. But rules, in general, teach us responsibility and safety.