The sentence is OK as it is. In this sentence what is actually being compared is the number of apples Tom and David have. The sentence should read: Tom has more apples than "Davids" (using the plural of the personal noun David) to match your interpretation (the author is trying to compare the number of apples to a person (David) rather than the number of apples that David has)
I hope this helps you. Do not hesitate to contact me should you have any further questions.
Student or Learner