I didn't read the book, but the movie seems pretty clearly to be about a haunted hotel, referencing the previous caretaker's murder spree. True that Jack's character was a broken man who was an insecure domineering drunk, but he wasn't mentally ill and he didn't kill his family because he went crazy from isolation. The isolation combined with his already low threshold for stress made him a vulnerable target for murderous intent by the hotel's spirit. I mean he wasn't possessed like Regan from the Exorcist or anything, but how else do you explain Danny seeing visions of the twins or the bloody elevator, having the shining with old man Halloran, having Halloran know that something bad was going to happen, or the photo in the closing frame of the movie if it's not due to an evil force at the hotel?
Anyway, regardless, my point is that possession doesn't equate to mental illness.