Thankfully I have never needed to volunteer to gain experience. For an individual to advance it may well be a good idea, but an organisation that relies on volunteers to run its core functions must be careful of being exploitative.
What is often forgotten in these discussions is that just because a volunteer is not paid, does not mean there are no costs to the host organisation. Recruiting and training volunteers takes time, and because all parties know that the work is voluntary not all tools of motivation are available. Furthermore since for an individual early in their career volunteering is unsustainable in the long-term (they need an income), there is a much higher risk that they will move on to a better job (i.e. a paid one), and you need to start again with another person, if one is available. Of course a good employer will encourage the development of the volunteer and rejoice when they move onto something better.
Approaching the question of devaluing the profession, I see no harm in defined length voluntary placements to gain experience, but I think long-term volunteering for a professional post is unhealthy to all concerned. An organisation gets the work of a professional librarian for far less that its real cost, which is mostly borne by the impecunious volunteer. That is simply unjust.