It’s common knowledge that Joseph Smith was involved in treasure hunting magic before he discovered the sacred tablet (I know some folks make a big deal of it, but it seems a silly thing to get worked up about). It’s somewhat less common knowledge that several North American Indian tribes buried their dead with metal (usually brass) plates. While it isn’t always noted, it is hiding (even from many practitioners) somewhat in plain sight that a lot of treasure hunting had as its final goal the excavation of grave goods. After all, most treasure buried in the earth was put there with a body, pirates notwithstanding (though, hah, there were usually a few bodies connected to pirate treasures too).
(Some old-fashioned mining magic doesn’t necessarily go this route, but the sort of liquid assets sought by treasure hunters? A lot of those are grave goods. Even if no one really remembers whose grave. In point of fact, especially if no one remembers the grave.)
The angel Moroni here is simply making use of a channel opened by Smith’s treasure hunting magic to point him toward his broader destiny.
What I want to add to this is the observation that even in contemporary folk Protestantism, we can find remnants of this allegiance between treasure hunting and the dead. Some decoration day observances include the use of grave dowsers, whose talents allow communities to locate and honor otherwise misplaced relatives. These sorts of observances are precisely the inverse of treasure hunting, concerned with the preservation of the burial rather than the necromantic invocation and manipulation of the dead and their stuff.