Subject to the court's right to award custody of the child to either parent, considering the best interest of the child as to its temporal, mental, and moral welfare the father and mother of any minor child born in wedlock are equally entitled to the child's custody, service, and earnings.
SDCL 25-5-7