It's called being sneaky with Spy
See that would work, but here's the thing. This is TEAM Fortress 2. You seem to be forgetting what would be happening right now if a Sniper really was holding your team back alone, you now have the rest of the team to fight, I'm not saying this is an issue for Spy, you can still kill the sniper, but by the time your team can push up that Sniper will be back, so unless you're literally waiting for him it's kinda hard to pull off. Essentially it's an extremely short term solution and usually isn't effective enough to really change the tide of a fight. (your team would literally have to be working together in order for your plan as Spy to work essentially, which is rare on pubs)
Sniper in my opinion is probably the most overpowered class.