What is right and what is wrong is a highly dynamic value system which has evolved through the human society's collective effort to perpetuate its existence.The need to have a moral system arises out of the need to perpetuate the human species. The moral system has necessarily to keep modifying in the context of the evolution of the human thought and the changing structures of the society.There is nothing absolute about any of the moral values and what is right in one society can be judged as wrong in another society. As to the need for the society to ensure its own survival by evolving rules of right and wrong from time to time,that appears to be a mere extension of the individual's own survival instinct.