You're both half right. Your teacher is thinking of the invariant mass or rest mass(see footnote [1]), which is thinking in the more modern and much simpler paradigm of naming properties of a particle-like "thing" in a frame of reference at rest relative to that thing and you're thinking of the transformations of the properties to effective values as seen from the standpoint of a relatively moving observer such that the simple, Newtonian version of Hooke's law can remain covariant, i.e. keep the same form from the standpoint of the relatively moving observer.
So, in short, you're not talking about the same descriptions.
I'd suggest that your teacher's is the simplest approach: we simply define the spring constant to be the quantity in Hooke's law from an inertial frame at rest relative to the spring's anchor point. Then, like rest mass, it is independent of frame. You'd simply work out the motion in the at rest relative to spring anchor frame and then transform the mass's world line to other frames as needed.
But let's look at what you need to do it from the relatively moving frame.
Although you have the right idea (we need to make laws covariant wrt Lorentz transformations) your approach as it stands is not workable, because $k$ cannot be a scalar - it only seems so in the Newtonian approximation. In the at rest relative to the spring anchor frame, $k$ is a linear, homogeneous transformation mapping displacement to force, so its simplest covariant form we could hope for is a rank two tensor:
$$F^\mu = -K^\mu{}_\nu\, X^\nu\tag{1}$$
where $F$ and $X$ are the four-force and displacement, respectively. $X$ is measured as the displacement of the particle, relative to the zero force point, so it is the displacement of the particle relative to the point $(c\,t,\,v_x\,t,\,v_y\,t,\,v_z\,t)$ from the "standing still" observer's standpoint, where $v_x,\,v_y,\,v_z$ are the components of the relative velocity between the frames. A form of the contravariant four-force that is particularly useful here is:
$$F = \gamma\,\left(\frac{P}{c},\;f\right)\tag{2}$$
where $f$ is our Newtonian three component force acting on the particle and $P$ is the instantaneous power transferred to the particle. From the frame where the spring's anchor point is at rest, we get $P = v\,\dot{v}$ which is a quantity oscillating at twice the mass oscillation frequency. $P$ could therefore only be a nonlinear function of the components of the four-displacement, and therefore even the tensor equation (1) is not workable!
The mass's energy is $E-\frac{1}{2}\,k\,x^T \,x$, where $E$ is the mass-spring system's total energy in the at rest relative to spring anchor frame, where $x$ is the three-component Newtonian displacement. The instantaneous power input to the mass is therefore $-k\,v^T\,x=-k\,x^T\,v$, a billinear function of both displacement and velocity. So the simplest form Hooke's law could take is:
$$F^\mu = - K^\mu{}{}_{\nu\,\xi} X^\nu\,V^\xi\tag{3}$$
where $K$ is now a rank three tensor, with $X$ and $V$ the four-displacement and four velocity, respectively. In the at rest relative to spring anchor frame, its components must be such that
$$K(X,\,V) = \left(-\frac{k}{c}x^T\,v,\,-k\,x_x,\,-k\,x_y,\,-k\,x_z\right)\tag{4}$$
(i.e. there are heaps of noughts and a sprinkling of $k$s and $k/c$s) and this is the entity you must transform by a triple Lorentz transformation, taking heed of which indices are up or down. I'll leave that as an exercise.
Footnotes
[1] To get a feel for the awkwardness of relativistic mass, and therefore why very few people use the notion, see my answer here.