Warfare is the failure of all other conflict resolution mechanisms. The goal of warfare is to end the capability of an enemy to continue to wage that war, so as to put them in a position where they have to acquiesce in the disagreement that could not otherwise be resolved. This means targeting strategic military and economic assets of an enemy.
Historically these assets have been human beings. Until very recently, even after the industrial revolution, manpower was the prime driver of an economy. It still is in most places in the world. As production becomes increasingly automated, the targets that will involve more loss of life will be military targets, unless military operations are automated as well. Automating military operations ensures less loss of life.
Automated weapons designed for defense, such as defense of a border or perimeter, are equally as morally defensible as manual defense using lethal force. The morality of the action in both circumstances is predicated on the right of the defender to occupy that territory. If a transgressor is warned that passing a point may end in loss of life and they choose to take the risk anyway, neither scenario is more or less morally defensible. Where do we get this idea that it is morally superior to have a guy do the killing?