What can cause muscle spasms in stomach?

Food intolerance. Stomach spasms are usually related to diet, but can also be due to gastritis, gall bladder, stress infections or inflammation. See your doctor to help sort this, but i also recommend that you look at your diet. See if there is something you are eating repeatedly that may be the problem. In my practice gluten and dairy are high on the list. Do an elimination diet with them for a few weeks.
Ulcer, acid, alcohol. All the above can cause spasms of the stomach itself. If you mean all the intestine inside the abdomen then anything that can cause obstruction like a blockage then constipation, kinking, adhesions, etc can cause muscle spasms. Also bacterial toxins and poisons.