Lewis, who won heptathlon gold in Sydney 13 years ago, said the 27-year-old has made the right decision.
"Jess has to think about the next few years and the risk of causing further damage," said Lewis.
"You have to ask whether there's more to lose than gain. For Jess, there's more to lose."
Ennis-Hill has been troubled by Achilles and heel injuries.
She withdrew from five meetings between May and July before competing at the Anniversary Games last weekend, only her second competitive appearance since winning gold at London 2012.
On Saturday, the Briton finished fourth in the 100m hurdles, clocking 13.08 seconds, but was eighth out of eight in the long jump, with a best leap of 6.16m.
Ennis-Hill has said she will now
"look to cure the problem",
while her coach Toni Minichiello explained there had not been enough improvement in the athlete's condition to ensure she could perform over two days in the Russian capital.
Colin JacksonFormer world record holder and BBC Sport athletics expert
"It's not a surprise she's pulled out. I don't know why she didn't make the decision ages ago. It's the type of injury that is the problem. It was clear at the weekend that Jess was really soft on the landings - 13.08sec in the 100m hurdles for Jess puts her on a par with all the other heptathletes and she's better than that. Her high jump would have been affected as well. We know she's a great 800m runner, but how much distance work has she been able to do? She could have lost in total 600 points across the board."
Lewis, whose British heptathlon record Ennis-Hill broke last year, told BBC Sport: "Jess looked better than I had anticipated at the Anniversary Games.
"Her time in the hurdles wasn't slow. She would be disappointed with it but most heptathletes would be delighted with that time.
"In the long jump, she achieved 6.26m at Loughborough recently and threw a personal best in the javelin. When you look at the scores from those performances, you think that is someone who could possibly compete.
"But I think she's made a good decision. Everyone else would love to see her compete, but Jess has to think about the next few years."
Lewis defied injury to claim gold at the 2000 Sydney Olympics. An Achilles injury threatened her participation in the 800m - the final event of the heptathlon - but, with her leg bandaged, she won gold with 53 points to spare over Russia's Yelena Prokhorova.
"When it comes to major championships, you have to make calculated risks and assess what stage of your career you're at," added the 40-year-old, who retired in 2004.
"For me, going into Sydney, it was almost now or never. I was 28 and it was crunch time. I had to be there regardless of my physical state.
"Jess has her gold medal. It's better she sits this one out, focuses on getting rid of the pain and not doing anything that aggravates it."
After gold in Sydney, frustrating battles with injuries followed for Lewis. She withdrew from the 2001 World Championships in Canada and suffered a three-year absence from serious competition.
Watch the moment Jess Ennis secures a memorable heptathlon gold
"I'm not too sure of the details of Jess's particular injury," explained Lewis. "But there are many cases of athletes training and competing through long-suffering Achilles discomfort, such as Andy Turner - the 2011 110m hurdles world bronze medallist - and Britain's former 400m runner Donna Fraser.
"At this point, however, Jess needs to concentrate on becoming pain free.
Ennis-Hill is one of a number of Olympic and world champions to have withdrawn from the World Championships, which run from 10-18 August.
Olympic 800m champion David Rudisha will not defend his world title, neither will 100m world champion Yohan Blake nor reigning world heptathlon champion Tatyana Chernova. All three are injured.
Such a high-calibre casualty list only adds to the admiration Lewis has for Mo Farah's "phenomenal" performances since he won double Olympic gold last summer.
"Full credit to Mo and his team that he is able to produce fast times and run well this year having had such a punishing schedule, both on and off the track, last year," said Lewis of the 30-year-old Briton, who is highly fancied to win 5,000m and 10,000m gold in Moscow.
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.