The 33-year-old world No1 withdrew shortly before she was due to face fellow American Christina McHale in round three.
“It wasn’t an easy decision,” said Williams. “I talked with my coach and he was like: yeah we are going to see how practice goes today, it wouldn’t be very smart for you to play, just not a smart thing, we have to make the right decision for the future and not for now.
“I said: I hate quitting and he said: this is not about quitting this is about making the best decision.”
Williams revealed that the problem occurred in Madrid earlier this month.
“It actually started a little bit in Madrid,” she continued. “I wasn’t serving my best.
“I just have to be able to have a serve and be able to hit my shots with a lot of confidence ….when you’re injured you don’t have that much confidence.
“But it so important to have it when you go up against any player whether it’s my match today or the final of the Grand Slam.”
MORE: The latest football news
MORE: The latest tennis news