Muscle spasms can be the result of many different conditions.
The most common are trauma and injuries. Certainly stress
can cause muscle spasms as well. There are many muscle and neurologic conditions that could be causing them. Some of the conditions are relatively benign and others can be more significant. I would see a neurologist of physiatrist for an evaluation.