"None of you [truly] believes until he wishes for his brother what he wishes for himself." (Bukhārī)
Building loyalty within a team at work, a place where people's livelihoods depend on the job, is already difficult enough. So how about when that team consists of volunteers who are only there out of their own free will?
This, like many other issues, is a leadership issue. Volunteers are reporting to a board or committee. The board and committee are often reporting back to a president or amīr of some sort. Even with small and loose volunteer groups, there is still some level of hierarchy and leaders are responsible for those volunteers 'under' them.
Even if you're not in leadership, these are still important tips to help those who are volunteering - and building loyalty within your community or organization.
The rules for this are simple, and don't require much elaboration.
People are humans. They have dreams, fears, and families. They have jobs, they have responsibilities, and they have life in general to deal with. Stop treating them like units of production. Treat them with dignity by showing them that you care. Know their names, know about their families and their kids. Ask about them (sincerely). If you can't show them that you actually care about them - as a person - then don't expect any loyalty from your volunteers.
When you see someone do something you would expect praise for, then praise your volunteers.
Whoever does not thank people (for their favors) has not thanked Allah (properly). [Ahmad]
When you make a mistake, you would expect people to overlook and pardon you. Do the same with your volunteers. The second you get up and berate or rip a volunteer is the same second that they will make the decision to never come back.
So when it comes time for reprimanding someone for making a mistake, give proper naṣīḥah. It needs to be prompt and private. And it needs to be done with mercy - hoping for rectification and hoping for the best for your brother or sister.
When you know you are competent enough to do a task, you usually hate it when someone micromanages you. Leave your volunteers alone. Let them work.
Above all, put yourself in their shoes. Treat them the way you want to be treated.