The act of sandwiching one's response emphatically between the word "sir" when addressing an officer or a superior to express enthusiasm. The canonical example is "Sir, yes sir!". It is most often heard in a training environment, as the real working military is, by and large, more laid-back about saying "sir" or "ma'am" after every sentence. Depending what branch of the military one is in, sir-sandwiching may or may not be common practice.
The Air Force, in general, does not train new airmen to use sir sandwiches. The Navy teaches an extra basic response which is "Aye-aye, sir," which means "I will do whatever it is you told me to do". For them, "Yes, sir" is the answer to a question; "Aye-aye, sir" is the answer to an order. The Marines teach "HUA," which isn't usually accompanied by any honorific--watch Full Metal Jacket again, and you'll hear a few sir sandwiches; watch GI Jane and you'll hear some Hua's. I'm not up on current Army training, but I suspect they still use the sir sandwich, at least in basic training, and probably at The Benning School for Boys. I'm sure karmaflux will correct me if I'm wrong. :)
While it is often used, like HUA, to show enthusiasm, it can also be used to tell a misguided superior that, yes, you're following their orders, but not because you think they're a good idea. If a sergeant ever sir-sandwiches an officer (especially a lieutenant in the field, the LT would be wise to take him aside and ask--offline--what he thought of the LT's command decisions, and if he had any suggestions at all to accomplish the mission more effectively.
And of course, in today's military, we have (God Bless America!) women in uniform, and often as not, they outrank a man they work with, necessitating the more pleasantly curvaceous and less-fattening "ma'am sandwich." Do not confuse these with sir sandwiches, or you will be doing Gender Bender push-ups for the rest of your natural life.