With an invisible illness, it's inevitable that some people are going to point a finger at any "bad" habits...
"You're a drinker? No wonder you feel so bad and have a hard time getting out of bed!"
"You drink coffee?! No wonder you have sleep issues!"
"You're a smoker?! No wonder you feel sick!"
"I bet if you changed your eating habits, you'd feel a lot better and wouldn't be so fatigued. Until I started eating healthy, I felt awful all the time, too."
It's not that making such lifestyle changes aren't beneficial, but it takes the focus away from dealing with the illness, potentially framing it as more of a behavioral issue than a debilitating medical condition. Until you address those habits, some doctors and some people just aren't going to take you seriously.
Of course, any resistance to making the suggested lifestyle change is often met with "Come on! It couldn't hurt to give it a try!" On the surface, that sounds reasonable, but the last thing a person with a chronic illness needs is yet another invalidating inference - that somehow, someway, they brought this upon themselves...that even if they do have a serious illness, it's their habits/lifestyle that elevated it to a disabling level...