So - here's a couple of different things. First, spycheck regimes. Spies cannot fire. If they do not fire when approaching you as you guard an area, then they are a spy, and must die. Teammates who do NOT follow this regime can be a pain, since they distract you - but they soon learn.
Spies HAVE to use the default weapon.
Shotguns are easy to connfuse with pistols though, and at long range you have an excuse. Firing is safer. Firing AT the defender is bad manners. Even if you aren't certain they are a spy. If they fall over dead on the floor, put another rocket into them.