This is a very good question. I think one reason why is that there's a real sense of accomplishment in building up your character or party, depending on what type of RPG you happen to be playing at any given moment, from nothing into something more powerful. And as in most RPG's, this takes a lot of time and effort in doing so. And while this can get a little frustrating and tedious at times due to the sheer amount of time and the inevitable number of deaths that will happen, it's also a great feeling when you eventually get strong enough and are able to defeat the toughest bosses and solve the hardest, most challenging puzzles thrown your way.
And while all of this is going on, you also find yourself being drawn into the actual story line of the game, which in turn keeps you plugging away at it even when you appear to be getting hopelessly stuck in a certain spot. You just want to see what's next in store for you and your group of characters or character.
It should also be noted that this not only applies to RPG/Adventure type games, but to some action titles as well. Like the Ninja Gaiden series of games for instance. Those games are super hard and there's been times I've wanted to quit playing them. But I kept on playing because I wanted to see the next awesome cut scene which would give away the latest plot twist in the story. And more often than not, I'd be blown away by them and as a result would keep on playing through 'em no matter how ridiculously impossible challenges those games would seem to throw at me. Of course, I've yet to beat any of them as of yet. But every time I sit down for a gaming session, I seem to get a little further, which in turn, makes me want to play them more and more. This also happens when I play a good old school RPG and that's why I like them so much as well.