Thinking that books should have secrets like people do implies that you think books are very much people in the first place; the further implication is that books have their own private agendas to execute upon the world by way their readership.
Books, if they had personalities and whims and manifest duties independent of the men and women who wrote them, would have no duties other than to be an enthralling, pleasurable reading adventure, the preferred result for the reader being an experience that challenges and shakes their assumptions, perhaps even depresses them a little, but which leaves them resilient above all else.
The writer is not obliged to make his fictions cohere with anyone's enforced standards of content and result; otherwise it would cease to be fiction, that is art, and become instead a lie, that is propaganda. The secrets books remain secrets until the pages are read. Quality control is impossible, though, and not all secrets are created equal. Many secrets are dull, tacky, tawdry, inane altogether. Not every sin is spectacular , not every indiscretion is evil, not every thought of mendacity is , in itself, worth of another world war, or even a disapproving slant of the head and crosseyed frown.
The more exciting secrets, the truly enthralling ones, even in the context of a novel, can make you wonder if you're any better off for knowing what indecent things a writer was purging in character garb.