it doesn't cause ulcers. that's the part of the theory that changed, rightly. But stress can increase the intensity of symptoms of the ulcer , changing it from non-symptomatic to a major pain in the stomach lining. So it's not surprising people once thought it was causative, since it was observed so frequently in ulcer cases. This area is still not well understood, although stress can decrease stomach pH as well as have immunomodulation effects.