Defending champion and world number one Williams was regarded by many to be the big favourite to triumph at Roland Garros this year.
However, she won just four games against Muguruza, who is ranked 34 places below her in the rankings.
"You know, it's great, because I'm going to go home and work five times as hard to make sure I never lose again. Obviously I'm super disappointed. I know for a fact I can play so much better than what I did today, so it's a double edged sword. I didn't play well, but I can play better," she told reporters.
The defeat has marked the first time in Williams's career that she has failed to reach the second week of a Grand Slam as the top seed.