A woman has gone through all the effort to go through pregnancy and delivery, this energy is just wasted to then kill the infant. This would be true for polar bears as well, and other creatures that practice infanticide, but other creatures do not have the ability to look ahead that people do, or to use other more energy efficient methods of contraception. They are simply acting totally on instinct. Natural selection does not pick the most energy efficient way - it picks the most energy efficient way given the parameters it has to work with. Most organisms in the history of life have gone extinct, these problems are not always solved.
Ants go to war, so do chimpanzees.
And so do people, obviously, and it can be another means of controlling population. Population was controlled. But people learn how to use metals and make better and better weapons, explosives, the competition doesn't kill the weak, it kills anybody unlucky enough to be in the way, the whole thing is so horrible that it doesn't exist as a constant low level stress, we have periods of peace inbetween insane periods of war. Without the constant low level stress of worrying about being raided, people reproduce like mad. Men are not constantly out on patrol or raids, both conditions that mean they are not reproducing.