What's so great about a medieval setting in fantasy fiction?
It's an escape to a simpler world. A low technology and thus less complicated world. Two-dimensional characters, people whom are easier to understand, is also an escape.
Meanwhile there is great hope because the hero has an ace up their sleeve. Finally there is magic and thus mysticism, which means ultimately no overriding reason to be nihilistic.