This seems to be, and to have been, well-nigh universal. Capture a spy and you get to torture and kill him. Capture someone who has been dropping high explosives on your cities and you are obligated (by the Geneva Convention, at any rate) to house and feed him.
I don’t get the distinction, as in why spying on the enemy is more heinous than shooting at him or blowing him up. Apparently this has been true for the greater part of human history, in that whatever mercies were shown to captured soldiers (for the most part, at least not executing them) have never been shown to captured spies. What gives? Does being spied on just piss off people more than being shot at?