From time to time, people challenge me on this; after all, popular custom is for everyone from gemara rebbeim to roshei yeshiva to non-practicing musmachim to opine freely on halachic matters. Why won't I?
I have several reasons, including:
1. The shul rabbi knows the community, and knows the impact of an answer given to a particular party;
2. The shul rabbi is responsible for setting a communal standard, which could be easily wrecked by amateurs;
3. The shul rabbi is the one who will need to pick up the pieces if there is fallout from the ruling;
4. The original system of semichah was designed this way, to have just one ruling authority in any given location.
The other day I came across reinforcement in the Chasam Sofer. Addressing a question put to him, he wrote (Chasam Sofer 1:123):
לא ידעתי אם יש רב יושב על כסא הוראה דקהלתכם כי אז אליו תשמעון ודברי כלא היוI don't know if there is a Rabbi sitting on your community's seat of halachic authority. If there is, you should listen to him, and my words are as nothing.
I think he was pretty clear on the subject.