Your mouth is densely innervated. Thus, the presence of an ulcer sensitizes these nerves and causes pain. You also use your mouth a lot to speak, eat, or perform unconscious actions like gulping, thus constantly using or moving your muscles and irritating the ulcer.