If they are necessary for a society to survive, then their productivity is manifested by the society's survival. Their product is security. Because of the state of the world, they are necessary as you pointed out. Without it, the PRODUCTIVE work couldn't happen, lest we end up plowing for those who didn't beat their swords into plowshares. It is a cost to the society, but it allows it to live and grow.
I agree ... and that's why I call it "protective". Soldiers, spies, cops, firemen do not "produce" anything, they protect those who do. In this fallen world, their activities are necessary, and honorable. Those who do it well should take pride in a job well done. Those who do other things should recognize the necessity of the protectors ... one of my big objections to leftists and pacifists is that they enjoy the protection, but spit on the protectors. It's hypocritical and dishonorable. In any case, I think the distinction (between protection and production) is worth understanding. That is all.