Yes, I think it should be legal... humans are machines. Very complex machines, but we are machines.
What do we typically do with machines when they stop working? We first try to fix them of course, but if that doesn't work we don't leave them sitting around the house - we throw them out. Why can't you do the same thing with humans? There's not much of a difference, setting aside your religiously-induced morales.