Smaug (and all other dragons) were created by Morgoth as species as warfighting machines.
As such, the desire to amass bling seems to be a somewhat... tangential feature, to put it mildly. If I was implementing the dragon, it'd get cut as creeping featurism from any project plan.
So, is there an in-universe explanation from Tolkien on whether this desire for riches was:
- A designed feature by Morgoth, somehow beneficial to the goals for making dragons
- An inadvertent side effect of some other design decisions (e.g. he used Dwarf DNA, for lack of a better terminology)
- An inevitable conclusion of his life history given some other features Morgoth designed
- Just a random bug, unique to Smaug, not explained by anything
I'm only interested in in-Universe explanation. The fact that Tolkien was basing Smaug on typical fictional dragon-hoarding-treasure archetype (warning: TVTropes link. Enter at peril) is 100% obvious and doesn't need stating. Besides, please note that most of said archetypical dragons were NOT created as engines of war by sentient master.