Well, I consider Kotor a pretty good RPG, even with those weak spots; the ending just kicks ass (evil ending).
Still, the big RPG boys would be, as I see them, among the best game I've ever played:
Fallout 1 & 2
Planescape Torment
Arcanum, even with its huge flaws
The Witcher
Baldurs Gate...