I think many developers complain about recruiters as a way of subtly bragging about how many people want to hire them. Secretly, they'd be kind of disappointed if the emails stopped coming.
This isn't a fair perspective. Recruiters are legitimately annoying. Especially as many recruiters obfuscate the hiring process so you can't just skip them directly to the company they're fielding. There's a long litany of abuses they take part in quite frequently, ranging from knowingly introducing you to companies you're not qualified for just because you're a "programmer" to deliberately making the hiring process for a company difficult without their direct participation.
I can't really argue with you if you've experienced this, but for what it's worth, all the developers I know professionally have legitimate reasons to dislike recruiters, and avoid them wherever possible.
I think it's unfair that people have their motives for disliking something called into question just because they're in a certain strata that has that problem and not everyone else does.
I'm not trying to say the recruiters are pleasant or anything. I just feel like the amount of complaining about recruiter emails is disproportionate to how inconvenient they actually are.
There's nothing wrong with disliking the emails--a lot of people get recruiter emails and just silently ignore them; a few complain loudly about them, and that's who I'm talking about.