Wes Welker should do the right thing ... and the right thing is giving BACK money he didn't rightfully earn at the Kentucky Derby ... so says his former teammate Shaun Phillips.
TMZ Sports broke the story ... Churchill Downs is asking Welker to pay back the $15k they accidentally overpaid him due to a machine malfunction at the track on May 3rd.
But Phillips -- who played with Welker on the Broncos last year -- says if he were in Welker's shoes, he would return the cash ASAP.
One of Shaun's friends has a different take on the situation -- and says he would keep the money -- but Shaun wouldn't budge in his position.
As far as the law is concerned, we spoke to a bunch of experts in gambling law in Kentucky and they all said the same thing ... Welker will probably have to pay the money back.
As far as Welker's concerned ... he told the track, "Get in line."
Stay tuned ...