Sharapova, the 2004 Wimbledon champion, had lost only seven games in her three previous matches at the All England Club this year.
She saved six match points against Kerber, but on the seventh sent a backhand long. The Russian made 49 unforced errors to Kerber’s 11.
Sharapova, who won the French Open last month, lost in the second round at Wimbledon last year.
The ninth-seeded Kerber reached the Wimbledon semifinals in 2012.