Literature does not always have to teach people a lesson; it can also be used for entertainment. It all depends on the person and their individual circumstances. Some people read literature for enjoyment and not always seeking a lesson, while others read for an educational enrichment. Not everyone benefits from reading.
yes, books should always teach you something even if it is just how to write using good grammar (structure of language), spelling (use correct letters in words), and punctuation (full stops, commas etc).
Every book teaches someone something n my opinion, even a children's book can teach an adult something about writing for kids (use lots of words to show sounds to gain their attention). I don't know any authors who have written or would write a book which doesn't teach someone something, perhaps you can specify a book or genre which doesn't teach someone something to show why books should teach people something.
From what I have read I'm guessing that you mean someone should always learn a moral, or something that applies to real life. Fantasy books tend to be very unrealistic, but they should still teach readers something in order to be interesting and they often do this by having a hero. This hero is never perfect to begin with because we must relate to him/her. Even if the story is unrealistic it still kind of has to make sense i.e. teach people something.
I said that it does not always have to teach a lesson. I personally feel that if someone has certain circumstances or ideas and their own opinions then they would learn something based on their own motivation and their personal self. However, if you would give someone who doesn't like reading or literature then I don't think they could learn like someone who is more connected to books. Some people just don't learn lessons from books, some do, I'm saying that it depends on the person and their beliefs. Whether or not literature is always supposed to teach something, it all comes down to the type of person and the characteristics as well as perspective the reader has. It doesn't matter if the book has a lesson or not, because it could teach one person something and if another person reads it, they could learn nothing at all. To sum it up, it's depends on the reader.
Someone who enjoys reading will learn more from a book because they will tend to ask their self questions, there are millions of books, it is not possible for a person to like them all, or even a large fraction. This is why it's important to read the back cover and to read a couple of paragraphs inside before attempting to read a whole book, the precise method for choosing develops naturally the more books that are picked off from a shelf.
Literature (books) should always teach people something e.g. how to select a book, and how to make a book attractive for others. This is what they do by simply existing. By being interested in a book yourself you can learn how to make others curious and attentive, which is a good quality.
I've seen books with bad advice, these books teach people that they shouldn't believe everything they read - a good lesson if you ask me. If books couldn't teach us anything no-one would buy them, or bother reading them, and so it would be pointless writing them. People learn the wrong lessons from books, however this is no reason why books shouldn't try to teach us something because those people will eventually learn the right lesson. Many people have to learn the hard way in life, it's how we learn and become better people.