First, let me say that for children and young adults, I think authors bear more responsibility to be moral in our writing than writers of adult stuff. Now, that doesn’t mean we shouldn’t write about edgy issues where moral decisions have to be made by the characters, or where kids get into trouble through immoral sex (sex out of wedlock), drugs, etc.
I think kids are struggling to find purpose and values in their lives. They want and need good role models. Adult readers don't usually care as much.
That said, I find it interesting that there seems to be a lot more immoral behavior being displayed in YA novels than there is in adult novels. At least that’s my observation.
I am of the belief that good fiction "mimics" reality. It does not have to display reality. I do not believe we necessarily need to describe everything in graphic detail to give a sense of reality.
I know Ellen will disagree with me somewhat on this issue, and I do not mean this as an indictment of her novels (which I think are great by the way – though not what I would write) but I'm of the belief that vulgarity and graphic sex are never necessary. These things can be eluded to, or "mimicked" without actually describing them in detail.
I believe we have a responsibility to our youth to be the examples for them to look up to. We should be examples of a better way, so to speak, and examples of morality. We are, after all, the adults here. I don't think we need to stoop to the level of vulgar kids who speak using fowl language and do immoral deeds. I think if we do display these things in our writing, kids get the sense that it must be okay. So-and-so (writer) talked that way.
I think we can allude to those things without describing them. Like I said, fiction only mimics reality.
I used to love Judy Blum's writing. She wrote some wonderful middle grade books that my kids loved, and I thought were cute. They told great stories and taught great morals. So, when she came out with a young adult novel, I can't recall the title of it, I was excited to read it – until I got about a quarter of the way through it. She began describing the sex act in vivid detail, making immoral (out of wedlock) sex sound wonderful. She made it appear as though sex for the main character was not only okay, but the best thing she could do with her life at that point. I didn't finish the book, it was too horrid, so the final outcome could be different that what I have described. I don't know. I didn't care to read any further. I almost complained to the library that it was borderline pornography, if not pornographic outright.
That, to me, is not what I could consider writing responsibly for children. I think we, as adults, have the responsibility to be the examples, not stoop to the level of those who would tear them down.