Earlier quoted context omitted.
Wait, IMAP sucks because you do something in a non-standard way (labels in GMail) that is exposed over IMAP in the best way it can fake (folder) and it is IMAP's problem that automagically do what you think it should? And just for added measure, deleting the label seems to me to be the right thing to do.
OP's point was that one of IMAP's weakenesses is that it provides no clean way to represent what gmail does.
However, most IMAP clients expose mailboxes as "folders" and barely support flags at all (no indexing, not even slow search, no UI at all most of the time, and if it even bothers to parse them, often has some silly limit like "five flags that must be configured ahead-of-time in Settings"), so users would have had a totally useless experience.
In essence, Gmail's IMAP is implemented the way it is not because it is the best way to map Gmail's semantics on to IMAP, but because it provides a reasonable fit to the way Outlook, Thunderbird, and Apple Mail (the only e-mail clients that have any marketshare) represent IMAP. Those clients represent trees of mailboxes as a folder hierarchy.
While commonly believed, people really need to stop blaming IMAP for Gmail: it's about as silly as claiming using HTTP headers as part of an API specification is impossible because none of IE, Firefox, Chrome, or Safari, allow users to modify the headers in their document-oriented web browsers.