I think the problem is that many patients prefer the idea that they have a physical illness, so some doctors don't even consider emotional causes. Also, doctors simply don't have the time needed to deal with these kinds of issues.
Yeah, I imagine most good doctors know full well it's emotional/stress, but avoid telling the patients because it's not what patients like to hear, or they don't think it'll be helpful.
Pharmaceutical treatments for stress have some harmful side effects, whereas just sending them away with "don't worry about it" and a lollipop might go a good way to alleviating some of it.