Your letter is chock full of uncertainty, and that's not good in a relationship.
First you say you "believe he loves" you very much, then you say you "guess" your weight gain is the main reason he won't sleep with you lately. You're filling in a lot of blanks that have multiple choices behind them.
Unfortunately, it sounds like your boyfriend falls into the stereotypical mold of a guy who doesn't communicate well, and you're trying to compensate and rationalize for that.
It's Probably More Complicated
Here's what I think: your weight gain itself may in fact be a reaction to some other stress in your relationship that is also related to your boyfriend's sexual disinterest, and the two things are now feeding off each other and compounding the problem.
If your boyfriend really loves you, your physical appearance shouldn't matter. I'm not saying he DOESN'T love you, rather that there may be other issues in your relationship that require attention but which he is not articulating and you don't know about.
For this to be resolved, you both need to talk about your feelings - that means that you need to hear for sure whether he loves you or not, and why he doesn't want to have sex, and you need to think very seriously about what's changed in your life that has accompanied your weight gain.
Incidentally, I'm assuming here that we're not talking about just a few pounds added on to an average frame, but rather a serious move towards obesity. It bears mentioning that most of the female images and bodies we are exposed to in the mass media are entirely unrealistic, at times literally dangerously thin, and that you should not try to model yourself after... well, models! Talk to your doctor about the ideal weight range for your body, and don't let magazines and TV dictate what you look like.
As in many situations, the bottom line here is communication. Good luck!