It could be because you change all of the water. It is never something you ever want to do since it removes all the good bacteria messes up the tank’s nitrogen cycle. Imagine if your landlord just moves all the furniture in your room without your consent, this is pretty much what happens, but the effect might be harmful to the fish. I’m going to assume that you are still a beginner at keeping a fish, since replacing all the water is a beginner’s mistake that a lot of people do.
One of the most important processes in keeping the water healthy for the fish to live is the nitrogen cycle. Also called the biological cycle, this is the cycle of how your fish waste and another biological process would end up being important nutrients that the water life would need to thrive happily. The process could take 2 weeks or even longer than two months. This is critical to keep tropical fish such as the betta in a non-toxic environment. If you want to monitor the cycle, you can purchase an aquarium test kit that will let you test for the various chemical levels in the aquarium.
Keep track of all the chemical balances, in the beginning, you should see the ammonia level increasing, then later one after a few weeks, the nitrite levels should rise while the ammonia falls. Then in another few weeks, the nitrate should increase with the nitrite decreasing. Once there is no longer any ammonia or nitrites detected, the water is not safe for you to add the fish in.
While you can start the cycle with fish, I would not recommend it, since you are exposing the fish to the harmful ammonia and nitrites. The fishes might not survive the process. Easier and cheaper way to start is to just drop in fish food, a few flakes every 12 hours. The decomposing food will produce ammonia and will promote the growth of good bacteria. You can also use a piece of raw shrimp or fish. You can even just drop 100% pure ammonia although I’m not very familiar with this method, something similar like a product that is specially advertised to colonize the tank with all the nutrients might work too.
By far the best and safest way is to us gravel and other filter media from an already cycled tank. Well, you will still need to feed the tank with fish flakes daily, but it is the fastest method as well. Once you get all the correct readings, it’s time to add the fish! Make sure to never fully replace all the water!