The Westing Game, by Ellen Raskin is a personal favorite because I love a good whodunnit.
Sam Westing, reclusive multi millionaire, is found dead, and sixteen heirs are gathered in the luxurious Sunset Towers apartment building for the reading of the will. The will is structured as a puzzle, with the 16 heirs challenged to find the solution. Each of the eight pairs, assigned seemingly at random, is given $10,000 cash and a different set of baffling clues. The pair that solves the mystery will inherit Westing's entire $200 million fortune and control of his company.
There are lots of twists and turns, red herrings, and excitement to keep middle schoolers engaged and guessing up until the very end.