Complete with a list of games within their respective classifications!
Medieval fantasy: Final Fantasy I (with highly advanced ancient civilization and even a "futuristic" dungeon in outer space! Easily my favorite dungeon)
Final Fantasy II-V and IX (IV had a hovercraft and spaceship to the Moon and a giant robot, so should I still count it under this? IX had Terra and genetically modified clones, but that was another dimension)
The Dragon Warrior series.
Breath of Fire I (an awesome game!)
World of Warcraft (is really an action game with some RPG elements like leveling up, HP, and MP thrown in there)
And of course Guild Wars
So many to count
The Mother Series
Final Fantasy VII (VIII could count kind of, but is more of a "30 minutes into the future" kind of a "present" though Ishtar is firmly in future territory)
The Arc the Lad series
The Secret World
Science fantasy/Science fiction:
The Phantasy Star series (1 was science fantasy with futuristic technology in a medieval society with magic and royalty. 2 was more straight up sci-fi with some fantasy elements, 3 was mostly a straight up medieval game ironically on a world ship with cyborgs from a long ago bygone era, but still counts as sci-fi for obvious reasons, and 4 is in a time like the present, but with Phantasy Star II era technology in ancient ruins and said surviving technology made space travel possible)
Star Ocean series (a really fun and involved series, I especially liked, "The Second Story")
SWTOR or any Star Wars game
It seems that developers shy away from either modern or sci-fi games much of the time, but why? I have a couple of theories, but they look beyond the RPG culture.
Fashion and architecture:
Modern fashion is relatively simple, and the architecture is plain and boring. Who wants to stare at either rows of uniform cookie cutter houses, and only houses in communities centered around cars, gray boxes, and tall glass? While the below video mentions bigger problems it nevertheless could explain away the shying away from making modern setting MMOs:
Also, you have a host of villains: corrupt executive, evil dictator, and sophisticated international cartel leader. The lawful evil guys will mostly be running around in suits: either in light gray with a burgundy tie or a navy suit, and lower down the totem poll a corrupt police chief who wears suspenders. Maybe a dark-pin stripped suit if they want to give the specific villain a cigar. The chaotic evil guys, on the other hand, will inevitably wear jeans, a black turtleneck, and maybe a barrette.
This is far less diverse than, say, robes, capes, shoulders, of countless different color combinations can have, as the differences here are far less subtle. Modern architecture also has a lot of gray, drab, colors and a boring uniformity.
Despite these obstacles Arc the Lad was still a great game to look at =) The Mother series was too, but it was bright and cartoony that helped it aesthetically.
Now, moving on to the future, we come to countless different approaches: You have the cold, sterile, and functional future, where nothing is beautiful, sometimes even with pollution everywhere (somehow, these societies, despite finding a way to break the light barrier, can't even be bothered with clean alternative energy sources lol!), and some writers even think we like looking and banal dessert all the time! Then, you have the future that is aesthetically pleasing and idyllic, and this is harder to pull off. Phantasy Star II and the Star Ocean series did this perfectly, and created societies that communicated, "People live here". There was sufficient green, and buildings were clean, but not sterile dead things meant for robots.
What do medieval games offer? There is a lot from which to draw. Gothic architecture and western medieval architecture is especially prevalent in the Dragon Warrior series.
Much of the world in such times is unexplored, most of the world's frontier isn't tamed, and that which is tamed, is tamed by societies your home society hasn't come into contact yet. In the present and future, however, the world is fully explored and national boundaries are firmly established, and with the presence of airports and cars, travel is far too convenient to plausibly make a long and epic journey. Towns also had a lot of space between them, so there is plausible wilderness between them that doesn't work as well as modern setting RPGs (though FFVII got away with it nicely but wasn't a "real world" modern setting)
How are you going to slash (or shoot) your way through mythical creatures if you are just driving by rows and rows of houses? The nearest town is always literally touching whatever town we're in at the time, unless you're really out of the way like climbing Mt.Everest or something.