In Appendix F, Tolkien suggests that "dwarfs" has become associated with more childish stories, so his use of "dwarves" is meant to disassociate his race from the others (bold is my emphasis, italic is Tolkien's):
It may be observed that in this book as in The Hobbit the form dwarves is used, although the dictionaries tell us that the plural of dwarf is dwarfs. It should be dwarrows (or dwerrows), if singular and plural had each gone its own way down the years, as have man and men, or goose and geese. But we no longer speak of a dwarf as often as we do of a man, or even of a goose, and memories have not been fresh enough among Men to keep hold of a special plural for a race now abandoned to folk-tales, where at least a shadow of truth is preserved, or at last to nonsense-stories in which they have become mere figures of fun. But in the Third Age something of their old character and power is still glimpsed, if already a little dimmed; these are the descendants of the Naugrim of the Elder Days, in whose hearts still burns the ancient fire of Aulë the Smith, and the embers smoulder of their long grudge against the Elves; and in whose hands still lives the skill in work of stone that none have surpassed.
It is to mark this that I have ventured to use the form dwarves, and remove them a little, perhaps, from the sillier tales of these days.
Return of the King Appendix F II "On Translation"
However, this is an in-universe retcon. The real answer is that Tolkien made a mistake, as he admits in a 1937 letter to his publisher (bold is my emphasis; italics is Tolkien's):
No reviewer (that I have seen), although all have carefully used the correct dwarfs themselves, has commented on the fact (which I only became conscious of through reviews) that I use throughout the 'incorrect' plural dwarves. I am afraid it is just a piece of private bad grammar, rather shocking in a philologist; but I shall have to go on with it. Perhaps my dwarf – since he and the Gnome are only translations into approximate equivalents of creatures with different names and rather different functions in their own world – may be allowed a peculiar plural. The real 'historical' plural of dwarf (like teeth of tooth) is dwarrows, anyway: rather a nice word, but a bit too archaic. Still I rather wish I had used the word dwarrow.
The Letters of J.R.R. Tolkien 17: To Stanley Unwin, Chairman of Allen & Unwin. October 1937
He admitted it again in a letter to the Observer:
And why dwarves? Grammar prescribes dwarfs; philology suggests that dwarrows would be the historical form. The real answer is that I knew no better. But dwarves goes well with elves; and in any case, elf, gnome, goblin, dwarf are only approximate translations of the Old Elvish names for beings of not quite the same kinds and functions.
The Letters of J.R.R. Tolkien 25: To The Editor of the 'Observer'. January 1938
Interestingly, he seems to have forgotten this error, or else he adopted his cover story as the "official" one; he gives the Appendix F explanation in a 1954 letter:
Even the dwarfs are not really Germanic 'dwarfs' (Zwerge, dweorgas, dvergar), and I call them 'dwarves' to mark that.
The Letters of J.R.R. Tolkien 156: To Robert Murray, SJ (draft). November 1954
Later evidence suggests the latter; in The Annotated Hobbit, Douglas Anderson quotes a 1965 interview where Tolkien again admits his mistake:
In an interview, Tolkien commented: "Dwarves was originally a mistake in grammar. I tried to cover it up, but the it was just purely the fact that I have a tendency to increase the number of these vestigial plurals in which there is a change of consonant, like leaf, leaves. My tendency is to make more of them than are now standard. And I really thought dwarf, dwarves; wharf, wharves - why not?" (Interview by Denys Gueroult for BBC Radio, recorded in January 1965)
The Annotated Hobbit "Introduction". Note 1