We are not at war now so the legality of it is not relevant to his case.
And a posting order can scarcely be construed as illegal.
His action, in refusing the order to go to Iraq, is intolerable and indefensible, however much one may sympathise with his views of the legality of the second Gulf War and our reasons for being there now. He volunteered to serve his country and has been well rewarded for doing so. Soldiers (and I include sailors and airmen) cannot cherry-pick the orders they will obey or we may as well contractorise the whole of our Armed Services.
If he feels that strongly, good for him but he should have resigned his commission. He could then have gone public. There will be no winners from this. He has disgraced us all.