David is no Achan.
Achan was the Judahite who seized plunder from Jericho, booty that belonged to Yahweh. Achan's sacrilege led to a disastrous defeat at Ai, which was erased only after Joshua executed Achan and his complicit family (Joshua 7; 1 Chronicles 2:7).
David is no Achan. When he conquers Gentiles and seizes armor and treasure, he sends it back to Jerusalem, to Yahweh (1 Chronicles 18:7-1, 11). The Chronicler's account of David's wars (1 Chronicles 18-20) contains a little chiastically constructed section that emphasizes just this:
A. David takes Hadadezer's gold shields to Jerusalem, 18:7
B. David takes bronze of Hadadezer's cities for Solomon's temple, 18:8
C. Grateful Tou of Hamath sends his son to greet and bless David to David, 18:9-10a
B'. Gold, silver and bronze (apparently from Tou), 18:10b
A'. David dedicates silver and gold from all his wars to Yahweh, 18:11
The order of metals is: Gold, bronze (vv. 7-8); gold, silver, bronze, silver, gold (vv. 9-11). Bronze is structurally highlighted, first by being given more attention than gold, and then by being structurally central in a chiastic listing of metals. We aren't told what David used the gold and silver for, only that it was dedicated to the Lord. But we do learn that the bronze was used for three pieces of temple furniture: the bronze pillars, Jachin and Boaz, which stood at the doorway of the temple; the great bronze sea in the court; and the bronze implements used for sacrifice at the bronze altar. Bronze is the metal of the courtyard, as gold is the metal of the inner sanctuary. Fittingly, plunder from Gentiles is used for the court, the one area of the temple where Gentiles were permitted to go.
Much of the plunder is forcibly seized, but not all. Tou gives his tribute voluntarily, out of gratitude. Hadadezer had been at war with Tou, and when David defeats Hadadezer, he also liberates Tou. David fights in order to defend Israel (cf. 19:13), but his wars also bless Gentiles who are willing to befriend him. Like Hiram of Tyre later in Chronicles, Tou is a type of the kings who, the prophets promise, will someday stream to Jerusalem bringing their treasures to the house of God (cf. Revelation 21:24). He is an Epiphany figure, a prototype of the magi.