Joseph Smith changed the pronoun it to them for the 1837 edition, probably because he interpreted the antecedent of it as the plural noun phrase “the words of truth”. Nonetheless, the singular pronoun is correct since the actual antecedent of it is the singular noun phrase “the truth” rather than “the words of truth”. The following clause confirms this interpretation: “for they love the truth and are not shaken”.
A similar example of the antecedent for a singular pronoun being the noun in a postmodifying prepositional phrase is found in the three-witness statement (although technically speaking, the witness statements are not a part of the Book of Mormon text proper):
In this case, the original antecedent for his was Nephi, not “the people of Nephi”. Joseph Smith was probably responsible for the 1837 change of the possessive pronoun his to their in the threewitness statement, just as he was in 2 Nephi 9:40 for the change of it to them.
Summary: Restore the original singular pronoun it in 2 Nephi 9:40 since its apparent antecedent is the singular noun phrase “the truth”.