It's interesting to compare D&D, which is arguably inspired by works like The Lord of the Rings novels, with those same works.
The Hobbit was very much a 'kill the dragon and take his stuff' with no pretense at morality involved. The dwarves motivation was greed, pride and revenge, with no thought at all of such niceties as 'defending the Lake Town residents from the evil dragon.'
In Lord of the Rings, to contrast, the 'adventurers' didn't go out of their way to hunt down and kill the enemy, whether orc, goblin or nazgul. Nor did they 'take their stuff.' Treasure was handed out by allies, such as Tom Bombadil, Bilbo or Galadriel. Fights where strategic battles, usually instigated by the enemy, or raids to reclaim captured assets (such as kidnapped hobbits).
D&D seems to follow the Hobbit model, where the adventurers may or may not give a hoot what the dragon is up to, only that it is sitting on a pile of phat loot. The existence of alignments, making the killing of some creatures (even if they aren't actually doing anything harmful), and stealing their stuff into a *virtuous* act only excuses and promotes this mindset.
A DM who wants to maintain a more Lord of the Rings style game, instead of 'kill things and take their stuff' would be better served to make sure that the adventure seeds involve rescuing people from a rampaging dragon, or stopping an orc invasion, rather than having the party hear about a dragon somewhere and be encouraged to go kill it for no reason other than to steal it's horde.
'Loot' would be necessarily spoken for, in many occasions, and replaced by *rewards.* The Orcs captured a caravan of goods that represented the years income for the hard-working peasants of Whogivesacrap, and the party is expected to return the stolen loot, *but* the villagers are willing to pony up a bunch of stuff they have no use for, like uncle Wilbur's sword, which is supposed to be magic, and those weird bottles of liquid that they found in the hut of that witch-woman they burned at the stake two years ago and that nobody has been brave enough to risk breaking.
Maybe the dragon snatched up the baron's tax shipment to the king, and the baron will offer the party all sorts of stuff to recapture it, and hey, according to the shifty guy who approached them after it, the king *hates* the baron, and wants the party to take their sweet time, so that the baron twists in the wind and misses his due date, allowing the king to 'graciously grant him an extension, in light of his extrenuating circumstances, in exchange for certain considerations to be named later...' The party kacks the dragon, and obviously, unless the dragon was running a mint, every single thing it has in it's horde belongs to *someone,* and boy do they pour out of the woodwork, each with their hands out, but the party can look forward to collecting rewards from the baron, king, local villagers, etc. for their 'heroic deeds.'
Ah, and if the party finds out that someone leaked the tax shipments route to the greedy dragon, and that said shipment only included *half* of the money owed to the king, well, won't the king find *that* to be an interesting datapoint...
IMO, it's the DM's job to set the tone of the adventure. It could be 'kill people and take their stuff,' but it doesn't *have* to be. Change the 'loot' to 'rewards' and change the motivation from 'murder for fun and profit' to 'saving people and getting rewarded for it.'