Actually, that's not quite right, Hookes law represents not the average force, but the force at a given displacement x. The energy approach appears to fail you because it assumes the mass is dropped from rest, which causes the spring to extend to twice as much than the first case where the mass is slowley lowered, before rebounding in simple harmonic motion. That means what you call h in the energy approach is actually 2x, where x is the displacement when the mass is slowly lowered by an external force to its equilibrium position, and then released, with no harmonic motion (no oscillation).
As an example, assume m = 1 and k = 1. You place the object on a hanging spring and slowly lower it with your hand underneath. When the spring force and weight equalize, that is, when kx = mg, you no longer need to support the mass, and it hangs there by itself at equilibrium, and x = mg/k = 10. Now if instead you just dropped the weight, using conservation of energy since there is no force applied by your hand, then mgx = 1/2kx^2 at the bottom of the drop when there is no speed to the mass. Solving, mg = 1/2kx, or 2mg = kx, thus, x = 2mg/k = 20, which is twice as much an extension than the first case. k of course is still k, k = 1, but the force in the spring is not mg, but 2 mg at that low point. .