The answer is calcium deficit due to reduced parathyroid hormone (PTH).
Thyroidectomy is a procedure in which the thyroid is removed. By removing the thyroid, the parathyroid can also come with it. Without the parathyroid the person has no parathyroid hormone to regulate the calcium in the blood, and low calcium levels cause muscle spasms.