Another common cause of muscle spasms is dehydration which can be due to many reasons, such as vomiting, diarrhea, or even inordinate perspiration. If essential fluids and salts are not replenished, an instability of the ion balances can occur in the muscles and nerves, which might lead to spasms. Muscle spasms can also be a result of neurological complications like strokes and metabolic diseases, which relate to the deficiency of enzymes in muscles.