Interesting you brought this up, I looked into it a little bit after my response on that other comment got some people talking.
I personally don't see it as a negative thing - I mean, yes, there are some places (like this forum!) that use it in a negative context, but my suggestion came from seeing it in Mac Mail where it's purely a way of making important messages stand out.
Having looked into it a little bit more, Outlook used the feature as far back as 1998 (possibly even before too?):
Microsoft themselves have an article, which they mention applies to Outlook 2010 which states that:
Applying a flag to a message or a contact in Microsoft Outlook gives you a visual reminder to follow up on it in some way. You can use flags with default dates, such as Today, Tomorrow, and Next Week, or customize your flags with specific dates.
Looking into the Apple Support forums, there's a support document for Yosemite which states:
An easy way to keep track of messages is to mark them with a flag. When you do, a mailbox for the flag appears in the Favorites bar and displays messages you mark with that flag.
Both of these instances are talking about using flags for the specific reason of ways for 'following up' as opposed to anything negative.
In my opinion, 'flagging for spam' is essentially just saying that you're 'marking' the e-mail as spam. The act of 'flagging' the e-mail doesn't necessarily mean anything negative, but certainly when you pair it with the word spam, it makes the context seem negative.
Therefore, I don't think there was a specific decision to make the word flag mean anything negative. Flag just means 'stand out' and this can be positive or negative.
In terms of why is first came into play in Office, I'm struggling to find that one. It makes sense in a world with terms like 'desktop', 'files' and 'folders' that another metaphor was used for making e-mails stand out, but why 'flag' was specifically selected I can't seem to find any material on - would love to find out.
The only suggestion I could make, is that upon some research it seems that 'flagging' is a concept within the 'C' programming language. In fact, it seems to stretch beyond C:
In programming, a flag is a predefined bit or bit sequence that holds a binary value. Typically, a program uses a flag to remember something or to leave a sign for another program.
This seems a pretty logical way for the term flagging to have made it into software, if programmers were using terms like this already.
I could be clutching at straws - but it makes sense to me at least. Interested to see if anyone else has any more insight.