Allah is The Absolute Wise and He has the Full Knowledge about everything and everyone. All rules in Islam are based on the absolute Wisdom and Knowledge and Mercy of Allah which aims for the interest of man and human kind.
illegitimately born child has no fault to be punished for, and he should be saved from social criticism. This might be one of the reasons that such person should not be exposed in public as leader of prayers or leader of society ( Marja' of Taqleed).
Keeping him away from regions leadership might be also for avoiding legitimising the sinful act from which he was born and not encouraging people to commit it.
Finally, we say that Allah is The Most Just, Most Wise, Most Merciful and He Knows the full reasons, but we firmly believe that it is always for the interest of man and mankind.