For most people, joining the gym is supposed to bring about desirable body changes. If you find deciding to join a gym and living a healthy lifestyle to be hard, sticking with it is even harder. But once you make that decision, it helps to receive some positive feedback. You can imagine how one feels when they see that instead, they have gained weight!
It is actually quite common for people to gain weight the first few months they join the gym. It becomes hard for such a person to agree to keep going to the gym if they cannot see something positive from experience. It is therefore important for them to understand how that happened, if they are to retain their gym memberships.
There is the factor of water retention. Exercises are a significant change in your life. As you exercise, there will be inflammation in your muscle fibers, and you build muscle mass. You end up with more water retained in the body. It is only temporary, so no need to worry. Go about drinking plenty of water, eating well, and sleeping enough.
The reason may be glycogen conversion. Your body needs to convert glycogen to glucose to get energy. With more exercises comes the need to store more glycogen to fuel those sessions. Glycogen binds with water to manage to fuel the muscles. As you exercise more often, your body becomes more efficient and thus needs less glycogen to keep up the energy. You end up retaining less water, thus attaining the weight loss goals.
You may also be struggling with a high-calorie diet. To lose weight; you need to combine the exercises with a caloric deficit diet. Out lives are chaotic to the extent that monitoring our caloric intake is almost impossible. As you keep taking more calories than you burn, you will not see any weight loss. At the same time, taking drastic measures such as an extreme reduction in calories leads to failure since it is not sustainable. Reduce it gradually over time. Stick to more whole foods than processed ones.
There is also the issue of time. You did not gain that weight you are trying to lose overnight. You will need more time also to lose it. The body has some clever coping mechanisms. If you introduce such a change, it will find a way to recalibrate and adjust. Your weight loss goal needs patience and discipline if you are to attain it.
There are those who also confuse muscle gain with fat gain. Working out results in you having more muscle mass. If you were to measure your weight, you would see that gain, even when you no longer fit in your clothes. You need to accept such a weight gain, as it is the healthy lean muscle kind.