When your goal is to help those in a foreign nation kick the ass of the United States (by, say, inducing them to go train in Pakistan to fight alongside the Taliban against the US) that can be considered treasonous. In case you are not following along, this is the Al-Timimi case.
When your goal is to get the American military to go and kick the ass of foreign nations and build an empire, whatever the idiotic bigoted basis for that goal (like, for instance, the fact that they are of a different religion) that is not considered treasonous. In case you are not following along, this is the Coulter case.