Maybe I'm naive, maybe my interpretation comes from the fact that I read the first book for the first time when I was 4, but to me it's always just been "humans can't be trusted with money, but here's a mystical race of little geniuses that can't be corrupted but will create intricate traps to make sure your treasures are safe", and thus it was ok with the plot.
Now as an adult I realize that the way their physical appearance is described may ring bells from nazi propaganda about Jewish people, but some elements don't really fit with that (their height, mostly) and I think people tend to forget it's a children's book that isn't supposed to bear a commentary on our society-and surely children won't make that wacky association.
I can't even guess on the actual reason Rowling wrote what she did but the trope of having a race other than humans horde gold or in charge of banking is really common in fantasy writings.
Now as an adult I realize that the way their physical appearance is described may ring bells from nazi propaganda about Jewish people, but some elements don't really fit with that (their height, mostly) and I think people tend to forget it's a children's book that isn't supposed to bear a commentary on our society-and surely children won't make that wacky association.