The first owner abandoned the dog to death and it should be dead in his life. The second owner gave the dog his life and deserves to keep it.
Its pretty obvious to me and I wouldn’t abandon my dog even if I had to carry down on my back.
By the way, what kind of idiot takes a dog into such a place in the first place?