We like mystery because life is mysterious, and storytelling exists to help us figure out how to live. Mysteries help us figure out how to deal with the unending avalanche of unknowns in our own lives (probably not directly, unless you deal with dead bodies a lot).
Some say that mysteries are popular because people like puzzles. Well, I like a certain kind of mystery, but I’ve never been a puzzle person.
I like Raymond Chandler mysteries, the hard-boiled detective who fights to stay alive while prowling dark alleys and darker minds. Often, I don’t care that much about the final reveal of who the real criminal is. It’s the journey, the tortuous path that I like.
In fantasy especially, the who-dunnit can easily become a what-dunnit.