Guilds do not usually have "laws", but they may have "policies" which serve a similar purpose. The policies are intended to set a standard way for the guild to operate, whether it is concerning acceptance into the guild, invitations to the raids, loot handling, or disciplinary actions. Having policies in place puts everyone in the guild on an equal footing: the officers are bound to follow them (or "uphold the law") and the members know what to expect and what is expected of them. Can the guild leaders make decisions which completely ignore the policies? Yes, but not without consequences.
When members do not do those things expected of them, it is perfectly reasonable for certain consequences to follow. And when they do follow, the member has little room in which to complain, for it was laid out in the policy to which everyone agreed. (By virtue of remaining in the guild, the members agree to the policies.)
When officers do not follow the established written policy, the members lose respect for their leadership. Members may develop cynical attitudes toward the leadership, because they do not know what to expect from them on any given day. They may become disgruntled and see favoritism in the actions of the officers, whether or not it was intended. The officers may justifiably be called capricious or arbitrary. And in a raiding guild, their discontent may be passed on in whispers to other raid members, thus undermining discipline and commitment--cutting to the heart of the common goal of the guild.
If the officers hope to maintain order, loyalty, and respect in the guild, they must follow the written policies they have established, even if they are not sure they want to do it. If they find a problem in the policy, the policy may be changed, but changing it on the spot, after expectations have been set, is no better than not following the policy to begin with. All things must be done in wisdom and order.
One of the biggest complaints I have read (or personally heard) about guild officers in various guilds is their unwillingness to follow their own policies or their unwillingness to establish policies. On the Guild Relations Forum, the first question asked of those complaining about guild leaders' decisions is, "What is your guild policy?" If the guild leader's actions are in keeping with guild policy, the judgement is that the member agreed to those conditions when he joined the guild, and so the guild leader acted appropriately. If the guild leader's actions are contrary to established, written guild policy, those on the forum agree that the member would be justified in either bringing up the case to the guild leader for reconsideration or in leaving the guild in search of one with better leadership (especially if there is a pattern).
A guild is a voluntary organization, held together only by common goals and mutual respect. Members stay because they believe the guild will help them meet their gaming goals and they will be treated fairly. Each person's definition of "fair" may be different, but by establishing and following a written policy, the leaders may attract and keep those who have goals and expectations in line with those of the guild. If the guild fails in either of these areas, the members will seek other guilds which meet these criteria.
These words were written by the House of Commons to King Charles I of England, after the king had made proclamations which appeared to be contrary to established law. They illustrate the importance placed on defined and consistent leadership:
Amongst many other points of happiness and freedom which your majesty's subjects of this kingdom have enjoyed under your royal progenitors, kings and queens of this realm, there is none which they have accounted more dear and precious than this, to be guided and governed by the certain rule of the law which giveth both to the head and members that which of right belongeth to them, and not by any uncertain or arbitrary form of government....King Charles I was eventually beheaded.