Why do We have Rules?

We have rules so that we can all evolve and get along the best way we can. Also so people will not get hurt and it helps society overall. It helps with self discipline.