In many FPSes one can crouch to improve accuracy, in TF2 it's not clear if crouching improves accuracy.
Does crouching improve accuracy for any of the classes?
What about a spy's pistol?
What about a heavy's chaingun?
How about shotguns?
There's an article on the wiki about crouching, and it says no, regardless what weapon you use:
Crouching does not increase your accuracy when firing a weapon, unlike in other Source games.
When you see Spies or Scouts crouching while firing their pistols, either they aren't aware of this (i.e., as Dave says, they do it out of habit), or they crouch to avoid being seen, good for hiding behind barrels, low walls, fences, etc.
As was already mentioned, crouching has no effect in TF2.
Having said that, certain weapons are more accurate as certain times.
The Spy's revolvers (all 4 of them) and the Scout/Engineer Pistols always shoot straight down the sitght for the first shot. Any subsequent shots taken without letting it "cool down" will shoot randomly within a cone shape. The cooldown time is easiest to see on the Ambassador, because its sight tells you when the gun has cooled down, which is also necessary for Ambassador headshots.
The Shotguns, Scatterguns, and Pepperguns shoot one pellet straight down the sight. Where the rest go depends on the server's weapon spread setting.
Miniguns always shoot shots randomly in a cone, although I've found out that the Tomislav's cone is smaller (and thus more precise) than the standard Minigun. Whether this is intended or not, I'm not sure, as this isn't a documented affect.