The Castle of Otranto certainly feels like an unusual book nowadays, but it would also have seemed that way to readers in the time in which Horace Walpole was writing. This is because it's generally regarded as the first novel ever written in the Gothic genre. Walpole was trying to create something entirely new while still using stylistic and thematic elements drawn from contemporary realism and medieval romance. When the second edition of the book came out, Walpole even added a subtitle to reflect this experiment: it was published as The Castle of Otranto: A Gothic Story.
The Gothic became wildly popular across all genres of literature after The Castle of Otranto was published in 1764. Walpole's writing is full of darkness, torpor, and intense drama, which later became typical of Gothic novels in the 18th century and beyond. The structure of the castle itself is one of the first examples in Western literature of the "unhomely house," a trope that appears in almost all Gothic novels after the 18th century. Themes of death, decay, and the growth from innocence to maturity are now considered characteristic to Gothic literature and are central to The Castle of Otranto. Gothic novels also very often have supernatural elements and feature unwelcoming homes, revenge plots, and vicious heartbreak. They are designed to invoke fear and unease in a reader while still being exciting.
This book also belongs to the Romantic genre of literature, in which the sublime, the extreme, and the individual take center stage. Romanticism was one of the most dominant genres of literature published in the 18th century in Britain and Europe. Romantic novels often celebrated the glories of nature and touted the value of solitude, reflection, and melancholy in understanding the human experience. Female characters were usually portrayed as flawless and idealized, and they were often put under threat by dastardly and amoral male villains. Many well-known Romantic novels are also Gothic: for example, Mary Shelley's 1818 book Frankenstein draws deeply from both genres.
Walpole also incorporates lots of elements drawn from the medieval romance genre. This type of tale is also sometimes called the chivalric romance and was written in Europe and Britain roughly between the years 1066 to the late 1490s. As a reader might expect from its name, literature that falls into this category focuses on chivalry, betrayal, love, and honor. It often retells fairy tales and folk tales in medieval settings, and it usually features tangled storylines that resolve into moralistic endings. These stories are sometimes allegorical and depict idealized heroes who perform grand romantic gestures of courtly love. These men (it's never women) undertake dangerous quests for the glory of the Christian God to win the affection of various different paramours and to gain honor and titles. The complicated plot, castle-and-court setting and religious undertones of The Castle of Otranto all reflect this genre. Other elements of the medieval romance are visible in its references to burlesque lust and violence, incest, and the influence of the supernatural on everyday life.