4. Medication
A number of medications can cause twitching and muscle cramps and spasms as a side effect. This might be because they cause muscle contraction, it might be because they cause dehydration, or it might be because they raise stress levels.
Whatever the case, it is important to ensure that you check this potential side effect when taking medications or speak with your doctor. It might be that there is an alternative option for your meds that can provide the same benefits without this unwanted side effect.