it's tricky. It's because there is a difference between 'momentarily at rest' and 'hanging'. Hanging implies that you are permanently at rest and so a=0 therefore the net force is zero and so:
0=kx-mg
However when something is momentarily at rest, v=0, but acceleration does not neccesarily equal 0 and so net force is not neccesarily 0. When you imagine it, the net force on Sam in this case is actually not zero since right after this moment he is going to be pulled back up. Basically in this case sam is momentarily at rest because he is at the turning point and so v=0(just like in projectile motion where v=0 at turning point, but as you know in projectile motion v=0 at turning point while the Force is non-zero!)
The sam-rope system is made up of three energies:
E=Total Energy
GP=Gravitational Potential
EP=Elastic Potential
KE=Kinetic Energy
GP+EP+KE=E
(Subscript i means initial)
Initially

and

and so:

(1)
(subscript f means final)
At the instant we are interested in. Because v=0(momentarily at rest),

and so:

(2)
However because

(conservation of energy) we can equate (1) and (2):


And so the Elastic Potential Energy at the turning point is the change in Gravitational Potential. So energy analysis simplifies this situation correctly and does not worry about net forces(and hence accelerations) but rather velocities because we are considering kinetic energy.