Some get worn out, but most of the parking is purely for economic reasons.
Some military aircraft have low life cycle times and some are kept alive through programs that would bankrupt a commercial operator.
Commercial aircraft have to be run on a logical and cost effective basis.