An engineer builds stuff. A spy saps the stuff the engineer builds, and utterly destroys it in a matter of seconds. Naturally, they are really annoying. The engineer thinks so as well. That's why he yells out "Spy's sappin' mah sentry" in pure fear and helplessness.
Also the inspiration to "spy's a spy!", created using digital soundboards.
The phrase is mostly used to describe a sense of fear, despair or pure hate when someone completely ruins whatever you're trying to accomplish.