Please let me invite to everyone's attention that the NEC does not prohibit a panelboard from being inside a clothes closet. :happyno:
Read 240.24(D) again, and keep Charlie's Rule in mind.
That article presents us with "clothes closet" as an example of where "easily ignitable material" might be found. But its prohibition is not with regard to the installation of overcurrent devices in that type of room. The prohibition is with regard to the "vicinity" of the "easily ignitable material." Merely having a panel in the same room as a shelf full of clothes does not mean that the panel is close to the clothes. If you can construct a clothes closet in such a way that a panel can be in the room, but still not be in the vicinity of the clothes that are stored in the room, then you will have complied with the code requirement.
The book does not tell us how close you have to be, in order to be in "the vicinity." So my own interpretation would be three feet all around is all you need. I base that number on the working clearance distance. But that is more than just maintaining the required working clearance, since 110.26 would allow a shelf to be immediately adjacent to one side of the panel, so long as there is 30 inches of clearance towards the other side.