Williams got a kick on a blue in the deciding frame when he was on a break of 20 and in a promising position.
"I probably would have made at least 40 or 50 in that frame if it hadn't been for that kick on the blue," he said.
"I was a little bit sick to go out like that. But what can you do? It's just one of those things."
Williams - twice a Masters champion in 1998 and 2003 -  levelled the match at 4-4 after coming back from 3-1 down at the interval.
Selby had made the highest break of the tournament, 139, and a break of 109 to take a two-frame lead into the interval but the world number 15 won three of the next four frames against the world number one.
After going 5-4 down, the Welshman forced a decider with breaks of 53 and 58 in frame 10 before his misfortune in the decider.
Selby, who is aiming for his fourth Masters title, wrapped up victory with a break of 89 and Williams was full of praise for his opponent.
"He's a class act on the table and off the table. You can't have a better player to represent our sport than him - he played fantastically," Williams told BBC Wales Sport.
Despite defeat, the 41-year-old was pleased to have competed in the Masters, which is restricted to the top 16 players in the world rankings.
"It's nice getting here - it's only the best players in the world," Williams added.
"I don't know how many more times I'm going to get here but I certainly enjoyed it. Even though I was a bit unlucky towards the end I still enjoyed it."
Wales' Mark Williams says he was "a little bit sick" after losing 6-5 against world champion Mark Selby in the first round of the Masters.