I think it would depend on the illness. And yes if there is a definite health risk to mom and or baby then of course a doctor has an obligation to point out the risks and strongly advice against it accordingly. Strongly advice doesn't mean forbid. It's still your choice whether or not you take their advice smile
All I can say is that if you do want kids in the future-near or far-do every thing you can do to make yourself healthier in the meantime.