Why are a lot of mountain bikers looking to get hubs that make loud sounds? Does it have an advantage or use on the trails?
As the other answer indicated its more about the quality of hub than sound. It just so happens that many higher end hubs have a more distinct click to them. This is present for multiple reasons. The spring tension on the pawls tends to be higher than cheap mass produced hubs, letting them "snap" down onto the step for instant engagement. They are also more finely machined than standard entry level components allowing very fine tolerances and clean crisp operation.
The materials used can sometimes effect this as well but the alloys 6061 and 7075 are common in higher end hubs. Steel would have less of an audible click as it would muffle it some and generally steel hubs are not the same quality.
With that said there are silent hubs, generally used for police bikes so that they can be a little sneakier when rolling up on a perpetrator. There are also high end hubs that make less than standard amounts of noise.
I also think a big part of why people are drawn to them is the fact that it makes them feel like they have something nice, sense a lot of people now a days do associate it with higher end hubs.
The only real benefit relating solely to the sound i can think of would be for mixed trail use where it may help alert others to the fact you're barrelling toward them.
I'm sure greater knowledge will make itself known here, but for me it's more about the quality of the hub rather than the noise which draws many bikers (roadies included) and 'quality' hubs tend to be louder when freewheeling.
I'm thinking specifically of Hope and Chris King hubs here, I think the noise is a side effect of the components, but I have no idea why they are louder!