The world number one, knocked out of the singles by Alize Cornet on Saturday, was competing with her older sibling in a second-round match against Stefanie Voegele and Kristina Barrois when a viral illness took its toll.
Serena was noticeably disorientated in the warm-up and the 32-year-old received medical attention before the contest.
She chose to play on despite feeling unwell, but with the score at 0-2 the problems became clear for all to see as Serena struggled to pick up a ball, and when she tried to serve her efforts lacked any of her trademark power.
After four double faults from Serena in game three she retired from the match and the 17-time grand slam winner revealed she was devastated at having to make that call.
"I am heartbroken I'm not able to continue in the tournament," Williams said in a statement. "I thought I could rally this morning, because I really wanted to compete, but this bug just got the better of me.
"I want to thank my sister, Kristina, Stefanie and our team for their support. We were all looking forward to a great match.
"From the bottom of my heart, I thank all the fans for their cheers and understanding. I look forward to returning to Wimbledon next year."