My heart is heavy. Vent about a dog.

So my husband and I got a dog from a couple when we lived in Louisiana who couldn't take care of him. They pretty much neglected the dog, they told us they had him stay outside all the time but that he was well trained, had all his shots, and was in great health. After taking him home We found out he had worms. We took him to the vet and he tested positive for hook worm so we got the medicine, and got him current on shots. The following month came and we noticed he still had worms in his stool so we took him to a different vet and there they told us it was tapeworm which needs a whole different kind of medication. So $900 dollars later he was worm free. During this time of the worms and having him he would constantly throw up and poop in his kennel. So we figured once he's better it will have stopped. However here we are today and he still hasn't quit. We took him to the vet about it to see if something was wrong and another couple hundred dollars later they couldn't find anything. So we decided to get him training to see if it was a behavior issue And this was an expensive 2 month training. For 2 weeks he stayed with the trainer and she worked with him on her own then the rest was with my husband and I. Even after that he hasn't stopped. And it's not like he does it all the time it's just randomly. Like he's done it all this week and it's always at night when we are sleeping. He doesn't let us know he needs out or anything. He is kenneled trained so we even thought maybe if we leave him out at night instead it'll help but that hasn't helped any. He will just go down stairs and it on the rug. Last night I had my husband get up with him since I was just exhausted and was not about to deal with it. So this morning my husband tells me we need to get rid of him. Which we have been discussing a little since I'm now 8 months pregnant and it's starting to stress me out and take a toll on me. So back to this morning, my husband wants him gone by the time he gets off work, and my heart is so heavy. I have no idea what to do. I don't believe in taking animals to the pound. Especially since here they only have a week or 2 to get adopted until they get put down. I'm thinking about looking into rescues. Has anyone ever been through something like this before? I don't really need to hear any rude comments because I already am feeling horrible and have been crying all morning about it. I just don't know what to do anymore. We have tried everything.