Warning: this is no nice neat conclusion...
Here's what I think as a writer and a reader (and a parent, as it happens): kids swear. Therefore showing kids swearing in books is valid. I would probably not enjoy reading a book where every other word is a swear word, but then I don't like TV shows and films like that either. (I've also never come across such a book for kids or YAs).
But here's the rub: as a teacher, it can be a bit more tricky. For the last 10 (or so...) academic years, I have taught over-16s exclusively: sixth formers and adults. Now, in a sixth form situation (and studying A Level Language no less), I'd seen kids get very, erm, over-involved in any swearing in texts, and it can be quite a challenge to get them to notice anything else in a text peppered with profanity. It's amazing how their maturity levels can plummet when faced with swearing (or, of course, the bane of the English teacher - sexual reference).
Since September, I've been working with younger students in secondary school and have discovered the absolute lesson-halting power of even the mildest 'naughty' word. In reading Skellig as a class text with year 7s, the relatively weak "bloody" caused hysteria among the less mature in the class and Leaky's fondness of the word "bo**ocks" (forgive me the coyness: some people read blogs in schools...) nearly led to injuries.
So now, I'm less sure and have a lot more sympathy with those who avoid texts including swearing in the classroom. With Language A Level students, mocking their immaturity is always an option, but it's harder to explain to the less subtle members of year 7 why sneaking in a quotation with a swearword in it to demonstrate every possible point is a bad idea, or why it's okay for Leaky but not for them.
What do you think? Do you remember reading books with 'bad words' in at school? I remember studying Tony Harrison's V for A Level Lit, which was (in the early 90s) shocking enough that the new and edgy Channel 4 made a film of it. We had to bring letters home to get permission to read it. I don't know what would have happened if someone's parent had said "actually, no". I also remember us being embarrassed in reading and discussing the language, but I don't think that the strongest words were as commonly heard then as they are now.