In a broad view, societies use rules to regulate unwanted or harmful behavior and to encourage wanted or beneficial behavior of individual society members. Rules are dictated by the values of the culture regarding what is viewed as acceptable or unacceptable for individuals in a society.
In any organization, rules are established to prevent chaos and encourage uniformity. Rules also tend to make things more fair. Take baseball as an example of the need for rules. If there were no rules in baseball, there would be no way to play the game or determine a winner. The game would be complete chaos with no discernible pattern. In baseball, rules are even being changed and developed in an effort to make the game more interesting, while ensuring that the game is played fairly.
Parenting is another area where rules are important. Raising children with rules prepares the children for the real world, which has rules governing every aspect of life as an adult. Rules are also valuable because without them people feel insecure. While chaos makes people feel unsafe and unsure of their place and roles, rules encourage order, which makes goals and expectations more clear and allows both children and adults to feel confident, competent and safe.