What's the old saying? No good deed ever goes unpunished? :-)
I'm curious -- I assume that you and your colleague were travelling on separate PNRs? If so, I'm going to speculate that AA assigned upgrade priority to your colleague based on your own priority; that is, your PNR and your colleague's would have been 'tied' for priority on the upgrade waitlist. Computers don't believe in ties - one of you had to be listed first. Wanna bet that your colleague's AAdvantage number (or last name) is alphabetically superior to yours? If I'm right, then you probably should avoid putting anyone's name on the waitlist in the future unless your last name is something like Aames (or your AA# is 0000011)..
Of course, that shouldn't stop you from writing to AA to complain that a known non-status AAdvantage member was upgraded before you were! Regardless of the computer foibles that caused it, what happened was wrong and should be corrected.