imported post
In theory, a soldier (I will use the generic term "soldier" to refer to all members of the military, much as it pains this former Marine to do so) would be completely right to refuse an order repugnant to the constitution, as this is certainly an unlawful order.
The reality, of course, is that the definition of lawful is not clear to many in the service, and many laws which seem to violate the constitution have been upheld by various courts, or haven't been challenged yet. So if a soldier is ordered to confiscate weapons and round up citizens to compulsively transport them to disaster relief camps, there may indeed be some legal basis for doing so given all the awful laws Congress has passed, and the president has signed, in the last 8 years.
Should the soldier refuse to do so on the grounds that it violates the constitution, he may be in trouble because the authorities will argue that the law authorizing the action hasn't been struck down by the USSC and is therefore not unconstitutional (at least not yet).
Don't jump down my throat! I don't like this, I don't agree with it, it's just that I see this as being the way those in power will twist things in order to do what they want.
The next problem is that the military or the police*, are heirarchical organizations with top-down authority, where rank counts for almost as much as any concept of right and wrong and certainly for more than individual liberty. In fact, during Marine basic training, it was repeatedly drilled into my head that I was not supposed to think like a "stinkin' individual", but as part of the team, the brotherhood. It went so far as to treach me to hate individualism and treat anyone who went against the grain as Blue Falcons (slang for Buddy F***ers). We were no longer "slimy, undisciplinedcivilians" who just want to do their own thing, we were part of a team and our personal wants and needs were insignificant. Years later I am now enjoying my status as a slimy civilian and all the attendant freedoms that go with it, so I have to wonder about teaching your troops to hate them.
The result is that there is enormous pressure placed on the individual soldier to do exactly what he is told, and not to think excessively over the morality of the situation. When they order you to engage the enemy, they don't want you second-guessing the fact that are about to kill some poor kid who probably got drafted and doesn't want to be there, but who has also been trained not to think and will therefore kill you first if you give him a chance. They also don't want somebody with the power to lay waste to a city block or, in the case of nuclear weapons, whole cities, to suddenly grow a brain and start doing his own thing. They want the mission to be accomplished, and they want to maintain absolute control over their heavily-armed 20-year-olds, period.
The training is very effective for building a force that can fight on a high-intensity battlefield against a conventionally-equipped enemy, such as say, Saddam's 1991 Iraqi army. We mopped the floor with them in the blink of an eye.
But that very same training and mindset is what makes combat troops completely unsuited to the task of policing their own civilian populace. Countless historical events show the truth in this statement, just in North America alone. The Boston Massacre, for instance, was what happened when you put combat line infantry on police duty in one of your own cities. Not to mention the occupation of the South by federal troops during and after the Civil War, which led to the Posse Comitatus act (which, IIRC, has been allowed to expire, something we will someday rue).
Back to the original question, though, I think it's pretty certain that if a Marine battalion is ordered to impose martial law on your town after a disaster of some sort, and they are told to confiscate your weapons, the young ones will do exactly that and hardly think twice about it. Some of the officers or older staff NCOs, however, will probably question the order, and the braver ones may even stick their necks out a bit. I have known more than a few good ones. In fact, it seems that whenever there is a plan to misuse the military for something immoral like this, there are always at least a handful of officers who, being taught that honor is more important than one's own career, will speak up against it.
*ETA: I should say I included the word "police" here because of the trend among police in the USA to train and equip themselvesin an increasingly militaristic manner, thus forming the "standing army" we were once warned about.