I disagree with this. And trust me, I get annoyed whenever there are more than 4 spies on Mesa (usually leading to me having to leave my favourite class)
Why? Because once you enforce limits, you're not solving the problem, you're bottling it. There are, say, 4 spies on a team because 4 people want to play spy at that given point. When you limit it to 3, this means that someone who wants to play spy can't. Now if someone else wants to play spy, it adds to 2 people who are frustrated. They could try many things to get around the system, for example, going into spectator to force an autobalance and go on the opposing team, or general whining/annoyance on the chat. If they get to be the 4th spy, they might find that either the class isn't for them, or it isn't the right time, and get the hint, or else the opposing team might already know how to deal with that class and be ready.
I'll be frank, if there was a class on TF2 that, when stacked, tips the game to one side's favour, I'd agree. But that's the beauty of TF2, there's always a counter, always. Too many spies? Pyro/Jarate. Scouts? Natascha. Engineers? Soldiers. And so on, and so forth. The game balances itself out, like a gyro coming to equilibrium.