Let's examine the traditional reason adventurers go on adventures- to face dangerous challenges and collect fat loot.
Dungeons were presented as multi-level affairs that became more deadly as you descended to the lower floors, but the increased risk granted increased reward. Actual experience points from monsters were insufficient to level you up save for very slowly, so you actually earned xp for treasures hauled up from the depths (in addition to the occasional sweet magic item to give your character more options and power).
By 3e, however, it was noted that designing monsters around unknown variables like ability scores and magic items was difficult- who could say what a character could have, and when they should have it?
So at this point, treasure was the fuel to let you acquire magical items, which became a separate "xp track" of their own- in addition to what your levels got you, you could funnel gold acquired into purchasing items. At low levels this was your plate armor and masterwork swords, but eventually this led into utility items, consumables, and eventually bonuses to attack, damage, AC, and saves.
Unfortunately, despite multiple efforts, 3e's attempt to make item creation a fundamental part of the game led to busted and overpriced items. 4e decided to continue with the process of turning treasure into power, but took a more conservative approach to magic items, and removed custom item creation from the equation.
5e decided to make magic items optional, not really assumed in enemy design, and left entirely up to the DM how to implement (but with little guidelines as to how to use them). They then made magic items a little more robust, though with a catch that you can only ever use so many of them at once.
This has had several notable impacts on game design.
1) the DM is never really sure if giving out magic items will make the game less difficult than it should be, or if not giving out said items makes it harder than it should be.
2) When attempting to design monsters, there's presumably some expectation of magic weapons at some point, but when is unknown.
3) The capacity of magic items to grant new abilities to classes that are less versatile, as was their original intent, is wholly lost, as no one has any expectation of acquiring anything desired.
4) gold is almost completely vestigial beyond level 5, yet the DMG guidelines and WotC adventures continue to hand out great amounts of the stuff. Treasure is no longer even a real incentive for adventures, which affects the verisimilitude of the game- why even take on dangerous tasks, if the reward is effectively pointless?
Magic magic items available for sale, and giving players some choice in what they acquire isn't the only solution, since some people find "magic item marts" even more reprehensible than the uselessness of gold, but there should be something here!
Instead the DM is left to "figure it out" on their own.
(And yes, there are suggested gold piece costs for magic items in the DMG, but they are ludicrous, based on rarity, making a magic potion cost the same as adamantine armor or a cloak of displacement- in fact, using those costs, adamantine full plate is cheaper than actual full plate, lol).