Law is compiled, considering the social acceptance of an individual's or a group's choice. While every choice has its pros and cons, the law establishes which one outweighs the other. Abortion is choice to not birth a child. While infanticide is a choice to kill it after deciding to give birth.
sources:
Definition of law: the system of rules which a particular country or community recognizes as regulating the actions of its members and which it may enforce by the imposition of penalties.