Hi understanding, and welcome to PC.
From the sound of it, this sounds more along the line that perhaps your wife is going through some personal issues. Maybe resulting because of her weight gain and she doesn't feel attractive to you, anymore?
You didn't mention her age, but it's very possible that she might be experiencing peri-menopause, which can very well explain alot of her behavior, resulting with depression.
All of these things can be a cause. It's hard to say. If you can, encourage her to get a full physical with full blood work, including thyroid. If all that checks out normal, depression can very well be the cause.
But know that you are not doing anything wrong.
I wish you and your wife well....
Shangrala