Going from the history of gaming and seeing where it was used, an early contendor is Diablo 1, which came out in gaming1997. However, the best contender I could find for it issetting the trend in motion early was Diablo 12, which came out in 19962000. Here they used thema myriad of colors to clarify between different types of items.
They used gray for junk, whiteWhite for normalNormal items, blueBlue for magicMagic items, yellowYellow for rareRare items, orangeGreen for legendarySet items, and greenGold for an item that is part of a set. They more than likely used these colors because of their meanings and how they contrast the areas to which they would beUnique items.
After Diablo 2, World of Warcraft (released in 2004) was the next major game that I could find that started using color coding for it's loot system, and it was very easy to see it was based off of the Diablo 2 coloring system, which is the same for every game that uses the coloring system. Gray for junk, white for common, green for uncommon, blue for rare, purple for epic, orange for legendary, gold for artifact, and cyan for heirloom (with the latter two only being added in later additions to the game).
While Diablo 1 and 2 started the trend, I think it would be safe to say World of Warcraft really set it into stone.