I have a couple of approaches based on how they interact with me:
- If they send me a covering note explaining why they want to link with me, I respond politely, and if I see the relationship as adding value I will accept the connection.
- If there is no covering note and I don't know them or have a close connection I reject the request and use the "I don't know this person" option
- If they contact me saying they have read my profile and have a perfect role for me and then show that it is a generic role, spam, or even worse, one entirely unsuited to me or good for someone with 20 years less experience, then I typically respond to articulate the minimum I expect from a recruiter. (If they then respond rudely, which has happened, I let my peers know, and add them to my blacklist to ensure I never work with them again)
So I now have a core set of recruiters I trust, a few more I will work with, and a longer list of folks who will never get my business, as an employer or as a candidate.
Your approach may be one or more of those - early in a career it may be politic to avoid burning bridges, but later on you can get a lot of value in separating out the chaff and building strong trust relationships with those who actually do their job well.