For some reason, I thought it was illegal or could get one in trouble to fly the flag upside down.
It's not actually illegal in that you won't be arrested for it. It is, however, improper display of the flag, and thus disrespectful of it, to fly it upside down for any reason other than to request assistance with immediate physical danger. That means actual danger, not political disgruntlement or other forms of personal butthurt.
A lot of people, including quite a few on FR, seem to think that it's OK to disrespect the flag as long as it's done from patriotic motives. Strange logic.