I say it's less a matter of life vs machine, then it is "Innocence."
Killing a battledroid that is following orders to subjugate a planet gets no more conflict than killing a stormtrooper under similar circomstances. Luke didnt turn to the dark side for killing several million imperials that were just doing their jobs when he took out the death star.
Torture and death bring about pain, fear and suffering- and so these actions are on the dark path. If a droid is capable of feeling something resembling these emotions, evoking them can cause conflict.