It is said that:
$$ F = -m\omega^2 x = -kx, $$
so $k=m\omega^2$. Since $k$ is the spring constant it doesn't depend on the mass of the object attached to it, but here $m$ signifies the mass of the object. Then how is $k$ independent of the mass attached?