Seven-time champion Williams had been hoping for a fairy-tale return to Wimbledon since giving birth to her first child Alexis Olympia Ohanian last September.
But she struggled and eventually lost to Kerber, a 30-year-old from Germany, 6-3, 6-3.
After the match, Williams said: “For all the mums out there, I was playing for you today, I tried.
“Angelique played out of her mind.
“She’s an incredible person and a really good friend so I’m really happy for her.”
Williams, 36, was playing in only her fourth tournament since the birth of her daughter, which had brought near-fatal complications and a six-day stay in hospital.
“It’s obviously disappointing but I can’t be disappointed,” Williams said.
“I have so much to look forward to. I’m literally just getting started so I’ll look forward to it.”
Sky Sports presenter Jacquie Beltrao said that, despite having come a long way to be fit for the tournament, Saturday’s final had been “a match too far for Serena”.
However, although she had seemed “a little rusty”, she had sent a message to future opponents.
Beltrao said: “(It was) a massive message for everybody else – ‘I’m back, I mean business, I want 24 Grand Slam titles and I’m not going to stop until I get them’. It wasn’t going to happen today but I think it might happen soon.”
Watching from the Royal Box were the Duchesses of Cambridge and Sussex, making their first joint appearance without their husbands.
Kate, a patron of Wimbledon, is still officially on maternity leave but has made a few public appearances, including her youngest son Louis’ christening, and the Queen’s birthday celebrations at Trooping the Colour.
For Meghan, the day will have added significance, as Williams is a friend.
Williams, and her husband Alex Ohanian, were guests at the royal wedding, and she has spoken about the support her friend gives her on the court.
Before the final, Williams said: “We’ve always had a wonderful friendship. Every year for a couple years she comes out to Wimbledon, has supported me.
“Now she’s supporting me in a different role. But our friendship is still exactly the same. I look forward to it.”
She joked, as official royalty will watch her this year: “If there was a Wimbledon royalty, I would like to believe I would be Wimbledon royalty because I’ve done pretty well here in the past.”
Meghan and Williams first met in 2014, at a charity football match.
Meghan last watched her friend in 2016, and may have sat on the same court as her future sister-in-law, as Kate and William also attended that year.
Kensington Palace has announced that Kate will be back with William on Sunday to watch the men’s final between Novak Djokovic, who defeated Rafa Nadal, and Kevin Anderson, who got the better of John Isner in an epic semifinal.
Also supporting Williams were Tiger Woods, Lewis Hamilton and Anna Wintour.