Don't give up. You have enuf info now to see that the problem is in the tank, one way or another.
I know we are supposed to keep bettas in larger tanks, but I have two that live in 1/2 gallons. One was a transparent baby when I got him and how he is all blue and growing up. I just do 100% changes every 2-3 days. It's a pain and I use bottled springwater and I take out any poop I see with a baster pretty much 3x per day. But they are living and so far so good.
I put one of them in a 2.5 gall by himself and he deeply hated it. Just lay on the bottom motionless and went up to the top for air and then sank down again. I figured give him what made him happy: the little tank.
So you can do an experiment and see if you can put a fish in a small tank by itself and see if it lives. If so then it's not your water, it's the tank. If it also dies then it's something in the water. Don't give up!! You can make it.