I think that D&D has many horror elements, simply because horror elements have always been part and parcel of mythology and faerie tales.
If you read/listen to a lot faerie tales, they're straight-up horror stories, with suspense, mystery and mysticism built right in.
The reason I think that...