It comes down to philosophy…
This is an excellent article that covers my feelings about the books very well. Although the Harry Potter books are wonderful and fun, there’s very little depth behind the stories (which is fine for young readers, and older readers looking for an escape). But the depth in The Lord of the Rings, and the moral complexities that it tackles make it a work for the ages.