What does "storing an aircraft" technically mean?
Here there are some nice considerations.
You can basically divide stored aircrafts in two main categories: short-term and long-term.

From the link, for long-term:


  When discussing parked or stored aircraft, it is safe to assume one is referring to an aircraft that is no longer in operation and has been placed by the owner, airline or lessor into a manufacturer-approved storage regime to preserve maintenance and asset value. 


Instead, for short-term:


  However, some will also refer to stored aircraft as those that are between owners. [...] a transition [...] takes time and [...] As such, an aircraft will often be stored and out of revenue service for six to 12 weeks.


or


  Additional or unusually lengthy checks can delay the aircraft from revenue service for many months, during which time they are sometimes referred to as parked or stored. 


but in the end, to answer why they are not sold:


  With the exception of these transitions, the majority of aircraft in storage are there because they are no longer economically viable to operate; it is cheaper to put the aircraft into a storage programme than to fly it. 


You keep it safe so that you can scrap it.