Electrical panels are prohibited in clothes closets. In commercial construction, it is very common to have panels located in an "Electrical Room." Presumably, one can also have an Electrical Room in a residence, even if it's rarely done because home builders will find a cheaper way to do it. Other than the obvious difference that a closet has shelves and clothes bars, how does an AHJ who is reviewing residential plans for permits distinguish between an electrical room and a closet with a panel? Is it just the label on the plans, or is there more to it than this?
A closet with a panel WILL be filled with junk. An electrical room that can only be used for electrical is only deep enough for the panel. Residential inspectors know this, but they cannot really enforce the clear space rules. It is a Bill of Rights right to protection from unreasonable search by any governmental agency, which includes the local building official.
Until George W. Bush takes away all our rights to privacy, there will be junk stored in front of electrical panels.