It's sadly probably only because you changed 100% of the water. By doing so, you're destroying the beneficial bacteria, i.e. the biological filter. And you're basically killing what would actually keep your fish healthy, the bacteria that changes ammonia into nitrites and nitrates. Ammonia is incredibly toxic, and that is what killed your fish. It probably got an internal infection because of the bad water quality, hence the swollen abdomen. When it gets this far though, there's not much you can do since the internal organs have most likely been destroyed by the illness.
From now on, try to let your tank cycle by doing 50% water changes once a week instead

Buy some beneficial bacteria and add it regularly to your filter, also keep track on the water parameters, buy a test kit with tests for pH, ammonia, nitrite and nitrate, test daily the first few weeks and change water whenever the ammonia gets too high!
If you love your pets, this'll help you keep them alive and healthy a lot longer
