To serve the President of the United States, at his pleasure. At least that's what his commissioning warrant states. Subordinate officer (and enlisted) don't get to question the authority of command. Although a subordinate can challenge the legality of an order, they can't challenge the authority of a superior to issue that order (except in extremely limited circumstances), so long as that superior officer is in the appropriate chain of command. It's a subtle difference, but not at all an insignificant one.
This isn't even a close call. Barack Obama is the President. Military officers don't get to question if his election was valid or if he's fit for command. This Army officer will lose and his attorney has exposed him to prosecution under several Articles of the UCMJ.