To put it simply, there is no one thing that makes a great RPG, great.
The first thing I feel that makes for a great RPG is the combat system. Anyone can copy/paste the original combat system of Final Fantasy and have a combat system, but what sets RPGs apart is when they find something new to do with that system. Super Mario RPG was fun because of the timed button presses which essentially let you control your crits, Chrono Trigger was fun because it was among the first RPGs where you got your weapons out right there on the field instead of cutting to a new scene to fight. And if nothing else, the fight just has to be fun to watch. Skies of Arcadia's fight system wasn't really anything too special, as an example, but the battle animations were just so fun to watch that you almost looked forward to your next fight.
The next thing that makes a good RPG is the character customization. Many RPGs could have been great had the character customization not scared-off many would-be fans. Final Fantasy 7 is about as complex as you can get without scaring-off the more main-stream audience. It was quick and simple for people who weren't worried about the perfect Materia combos, but it had enough complexity to keep people like me interested enough to spend 30 minutes planning one character's make-up. On just the opposite, you had Final Fantasy 8. Not only was the stat system much more complex in that game, but it required you to sit there and nurse your characters as they spent countless minutes doing nothing but drawing spells from enemies. The hardcore fans of the game were willing to put-up with it, but the people who wanted to just keep playing the game quickly got over-whelmed by too-strong enemies that were balanced around the assumption that you'd been power-drawing every spell you can get.
Last, but not least, you have explorable area and extra goodies. Nothing makes an RPGer feel more defeated than when he sweats his way around a dungeon to explore every nook and cranny only to discover that there was absolutely nothing to be found there... why'd the developers waste their time adding all that extra space if they didn't want me exploring it? Likewise, the reward should be worth the effort. If I'm taking a 30-minute side-trip to explore a corridor, there had better be something better than a potion at the end of the tunnel. Although I suppose this one in particular shouldn't be labeled under RPGs-only, since just about any great game needs to have some incentive for exploration.
On that note, however, I guess that the things which make a great RPG are the same as for any other game. My first point was the combat system, but every game has its own combat system that needs to be fun, they're just different systems from what you'd do in an RPG. And many non-RPGs have character customization, just usually in different ways. Music is another important aspect to any good game, as it not only makes the game fun to play, but fun to watch. Having never actually played any DMC game beyond the first half of the first game (just didn't get into it), I love watching my friend play the games for the simple fact that they have good music.
So the simplest answer to the question of what makes a great RPG: The same things that make any-other game great. It's just the semantics that determine whether you're playing a great RPG, a great Action/Adventure, or whatever.