Several reasons, it seems:
Vicarious Experiences and Threat Mastery
Horror movies are a risk-free way to vicariously experience threats and rehearse one’s responses to those threats.
Plus, after people get through a horror movie unscathed, they may feel a sense of accomplishment and mastery over the threat they’ve experienced, which then leads them to feel more confident in their ability to handle other anxiety-provoking situations.
Excitation Transfer Theory
The theory proposes that horror media stimulates elevated levels of physiological arousal because of the fear they induce; when the media concludes, that arousal then intensifies viewers’ feelings of relief and enjoyment, leading to a euphoric high.
Studies have backed up this theory, at least for male viewers. For example, one study found that the more distress male participants reported and the more arousal they experienced while watching a horror film, the greater their delight after finishing the film.
Curiosity about the darker sides of Human nature.
Another study found that our enjoyment of horror movies can be explained by the fact that they satisfy our curiosity about the dark side of humanity, again, in a safe environment.
https://www.verywellmind.com/why-do-people-like-horror-movies-5224447
Latest Answers