Lets imagine we have a spring of a linear characteristic such that the force the spring exerts is proportional to its deformation $\delta$. The spring is attached horizontally to a wall, now if we stretch the spring by applying a horizontal force $\vec{F}$ the work done on the spring will be: $$W_{1\rightarrow 2}=\frac{k}{2}(\delta_{2}^{2}-\delta_{1}^{2})$$ where $\delta_2$ and $\delta_1$ are the final and initial deformations of the spring respectively and $k$ is the spring proportionality constant.
Now suppose we let go of the spring, the work done by the spring will be: $$W_{2\rightarrow 1}=-\frac{k}{2}(\delta_{2}^{2}-\delta_{1}^{2})$$
My question is why is the work now negative?