I'm of mixed mind. On the one hand, I confess to enjoying seeing the government getting bitten by its own regulations.
On the other and more rational hand, a bunch of other people let the agent get to the plane with a gun, clearly believing (and in these post-9/11 days they must have had good reason to believe) that he was a Secret Service agent.
Now if the pilot truly thought that the agent was not a Secret Service agent despite what airport security told him, then maybe I could sympathize with the pilot. But if the pilot believed that the agent was a Secret Service agent and still didn't want him on the plane, then the pilot is clearly wrong, as the plane is safer with an armed federal law enforcement officer on board than without.
So far nothing I've read suggests that the pilot thought the agent wasn't with the Secret Service. IMHO American Airlines has some explaining to do, unless it wants to argue that its pilot and ground crew didn't believe that the man was with the Secret Service.