I don't know if one would categorize Twilight Zone and X-Files as horror shows. The latter and certainly the former seemed more of a sci-fi show that sometimes featured horror.
I'd say that in the X-Files, the horror was front and center, being a series about supernatural phenomena even though some scientific/medical study of them (by Scully) was possible. These were the episodic stories, which was the bulk of the show.
It was only with the alien storyline that science fiction entered into things, and one reason we remember those episodes so well is that they would take a long time to get back to that, to build up the suspense. A few other strange situations may have been classifiable as SF, but the horror element of them was always concentrated on.
The Twilight Zone would do science fiction once in awhile, but the science-based stories and ones having to do with aliens or space would go to shows like the Outer Limits, shows specifically designed as SF. TZ was more about being disturbing, unexplainable or impossible horror situations, as opposed to anything based on scientific possibilities.