Remote controlled guns do not kill people 'indiscriminately'.
There is technically a war on between North and South Korea, and tensions are high. It's responsible to have defences in place given the fact that 500 000 N. Korean soldiers could decided one day to come rolling in.
The moral implications of the management of violence are real, but it's often necessary.
In a more limited case: you're a cop, a guy robbed a bank, he has a gun, he's running at you pulls up his gun and aims it you. Do you shoot? You could kill a man. You do and he dies. Are you 'guilty of murder'? Or have you actually done a 'moral act'?
I'm personally weary of all this border stuff, but the underlying motivation of basic security is real. That said, I don't think there are any reasons for weapons at the US border, surely there are criminal gangs but mostly I'd imagine it's just people.
If the US were to have had it's border problems solved 'normally' - over a long period of time and managed issues as they came up, we wouldn't be having this discussion. It's all due to a dereliction of responsibility over a period of time.
The inability of the US to just put 'normal' and 'basic' controls at it's border over time has caused massive political upheaval, to the point wherein I don't think a guy like Trump would have been elected were things to have been done properly. So now you have crazy politics, and crazy border proposals. Now the pendulum has swung a little too far.
So this is all a symptom of the governments inability to operate normally and deal with such problems normally. This never needed to happen. But here we are.
Automated defenses will attack North Korean troops. They could also attack lost North Korean children, South Korean military convoys moving to the new front 50 miles north a week after the bombing of Seoul in 2034, and hikers living in Unified Korea in 2067.
"Indiscriminate" doesn't necessarily mean "unjustified" or "illegal", but it's still enough of a marked category difference to be worth some separate ethical consideration.