I had a similar experience. I gained weight when I quit smoking. In my case, I was happy about this. Eventually, the weight gain evened out. I suspect because food tastes better, we tend to eat more when at first after quitting smoking.
I think it's mainly hormonal. Nicotine inhibits estrogen. A few months after quitting, I even kinda grew little moobs that eventually went away. But that was a small price to pay - quitting was well worth whatever shortterm discomforts I experienced.
Another thing I did when I quit was to constantly have toothpicks, breath mints, etc handy. I still to this day eat breath mints constantly, rinse my mouth frequently, etc since quitting. They're better habits to have than lighting up.