I think the problem is simply your keeping habits..
If your betta's eyes look cloudy, this is a bacteria infection caused from chronic poor water conditions, and judging from other keeping habits also a weakened immune system.
First off salt cannot be used for more than 10 consecutive days, and only if your fish is actually sick. It also never breaks down or evaporates so if you are using it, it should only be added along with a water change. Using salt for a longer period, when fish is not sick, or continuing to add without changing the water will simply breed resistant infections which will make the salt useless when the fish is actually sick. It can also lead to premature organ failure. If you have been adding salt on a regular basis, it needs to be discontinued now.
For the betta:
The size of the tank is good.
Your water change routine isn't even enough for a fully established tank, which should be 50% weekly with siphon. However cycling takes up to 2 months and there are any number of reasons it may break down later. Anytime you are not doing weekly 100% changes you really need to own a reliable drops kit for ammonia, nitrite and nitrate.
You need to be testing daily with a reliable drops kit for ammonia and nitrite and doing an extra 50% change any time you see either, even as little as .25ppm. In addition to this a weekly 50% with siphon is needed to remove poop and other debris from the gravel. It is not enough to just scoop water off the top ever.
First you will see ammonia, then nitrite. Eventually, hopefully, you will see ammonia fall and stay at 0 even after a week of no water changes, and finally nitrite. At this point you will be left with only nitrates after a full week of no changes and these can be kept <20ppm by twice 50% change with siphon.
However, Most filters designed for these small tanks also have fatal flaws that will not allow the biofilter to establish in them as well. You should never replace all filter media at once. You should only replace one type of filter media within a month, and the best filters have 3 different types of media. However, most of these small only contain one type of media that needs to be replaced monthly due to it containing carbon. Every time you replace all the media at once you wipe out most of your biofiler and basically start your cycle over again. The surface area available to grow this biofilter is also usually completely inadequate to support the load of the fish.
So what filter do you use and how to do you maintain it?
Bettas are tropical fish and must be kept at a temp between 76-82, with 78-80 being ideal. The temp must be stable and not be dipping or jumping around. In a 2 gallon you can get an adjustable 25w or 50w heater. Any new heater should be tested for 24 hours in similar size container with in tank thermometer to make sure it will hold a constant appropriate temp between 78-80F. Then the betta must be acclimated to higher temp either by floating in a cup inside the main already fully heated tank for an hour, or by adjusting the heater to increase the temperature of the tank no more than a degree per hour and 5 degrees per day.
Flakes aren't good nutritional value, and especially with something this small they muck up the water quickly causing excess ammonia. You should look for a good quality pellets whose first two or three ingredients are whole fish, not fish meal or wheat. He should be fed two small meals a day (how many depends on the pellet you pick up) and one fast day a week.
* Answer my questions above
* Discontinue salt if it's been more than 10 days.
* Get a testing kit
* Get a heater/thermometer and slowly acclimate to higher temps
* Get on top of water changes.. 3 50% water changes an hour apart now and then maintain as above
* Adjust feeding habits
* Share photos as your betta may need antibioitcs
All water changes should be done like this to avoid shock and minimize stress
The 50% changes the betta can be kept in the bowl and use a turkey baster to remove half the water and as much of the debris as possible. For the 100% you need to remove him - scoop him out with a plastic solo type cup and set aside while you thoroughly rinse the bowl and gravel to remove the debris. Then he should be acclimated to the new water by floating for an hour while you slowly add a couple tablespoons of new water to the cup every 10 minutes. When you release him, try to let as little of the old cup water back into the tank as possible. All water changes should use same temp water, matched to running tap using the in tank thermometer and the water needs to be premixed with conditioner before adding it to the betta tank. If you don't already have anything, you can use gallon water jugs from the grocery store - rinsed thoroughly in hot water but no chems.