Could a herniated disc at L5-S1 lead to spasms and muscle guarding of back muscles? Would a microdiscectomy operation help get rid of the spasms?

Possibly. A neurosurgeon is best qualified to evaluate you and review your mri. It's possible that the back muscle spasms is the body's way of reacting to pressure on a nerve root by the herniated intervertebral disc. After the evaluation your treatment options will be explained to you.