I don't believe authors need to keep any specific values or ideas in mind while they are writing for children, but I do think authors need to be aware of their audience, and of the effect their work may have. So if they want to address particularly sensitive topics or taboos, they have to do so consciously and carefully. This is very different to toeing a particular moral line or leaving things out.
Certainly I don't think good always has to triumph over evil; it depends on the story and the aims of the book. For example, I could envisage telling a story where the inaction of people leads to the triumph of evil. But I would include the hope that this would lead to the people involved doing better next time. Is that story then really about the triumph of evil, or is it about the awakening of opposition to evil?