Of course, any answer to this is speculation only. We want to understand, and cannot, so we fall back on speculative reasoning - which allows us at least a small step forward towards comprehension. Much like the mystery novel itself.
Many of us are compelled to unravel puzzles, cerebral or otherwise. So the puzzle of ‘who did what to whom, and why?’ draws us. It’s as simple as that. The mystery inherent in the act of murder -- the gravest of crimes -- is almost surely a factor, too. Many are fascinated with crime and it’s perpetrators, perhaps because we fear them, fear the sudden outbreak of violence, fear minds we can’t comprehend and can’t control.
Reading a mystery can give us a sense of understanding what motivates someone to kill, thus turning a fear into an intellectual exercise which allows distance.
And there are our simultaneous urges towards both safety, and the thrill of fear. Mysteries satisfy because the danger is contained, and does not impact our lives.
It could be too, that some of us believe we are all capable of violence, on some dim, barely conscious level, and thus it is a huge relief to discover, as we do in mysteries, that the villain is in fact a villain - someone very different from us. And he has been caught.
Mysteries allow us to have our cake and eat it, too. There is the excitement of the chase, the thrill of a grisly event that cannot hurt us, the sense of peering through a window into the hidden recesses of a criminal mind. And this: in most mysteries, “justice” is done. The wrongdoer is punished. The morals are absolute. We can close the book and think that all is right with our world.