If you were drinking, smoking, and doing other recreational activities and you stopped all of them around the same time.. It's only natural to gain weight. Baditude hit the nail on the head, you've probably replaced those addictions with a food addiction. The thing about food is you normally don't notice that you're eating more or not eating well. Not to mention quitting alcohol and other activities can really lead to lower levels of the chemicals in your brain that make you "feel good" for a while. That often leads people to sit around more and exercise less.
It's always easier to gain than it is to lose. You really don't have to think about anything to put weight on 10 pounds at a time. You have to concentrate and work hard to lose weight ounces at a time.
Start writing down your calorie intake. Look up your BMR and keep under that. If you don't currently, start working out at least 3 times a week. You'll shed weight as long as you do that. It can be hard, but I've personally found the addiction to food can healthily be transferred to an addiction to a healthy lifestyle. Just takes time and effort.
I've had a long history of battling weight. In highschool my weight topped out at around 400 pounds. Since then I've been up and I've been down. I do my best to keep under a certain amount of calories, I work out as much as I can and I drink a ton of water. I'm down to between 220 and 240 pounds now, a much better weight for my height and body size.