I also gain weight when eating gluten. If I eat gluten for only a week, I swell up by 5 pounds, and then it takes about 6 weeks to fully go away.
I've heard a few guesses about the mechanism:
- eating gluten somehow encourages overeating for people who are sensitive
- your body cannot get enough nutrition due to malabsorption, so you keep craving food...