Supermarkets were late bloomers among the Covid-19 winners, unrecognized last year during the pandemic boom but finally gaining steam this year. Kroger’s results Friday seriously disrupted that rally.

The chain had a decent quarter, with total sales exceeding Wall Street estimates. Same-store sales, excluding fuel, decreased just 0.6% in the quarter ended Aug. 14 compared with a year earlier, better than the 3.2% decline analysts had penciled in given the windfall during the pantry-stocking period last year. That didn’t all flow to the bottom line, though. Net income slightly missed expectations.

Much of that decline in profitability came from industrywide pressures. Supply chain costs and higher “shrink,” an industry term for theft and other merchandise loss, accounted for about half of that decline, the company said on a Friday earnings call. Organized theft has been an issue for a number of thriving retailers, including Home Depot and Target.

The 8% drop in Kroger’s shares, and the 6.5% drop in those of competitor Albertson’s, seem excessive following mostly upbeat results and guidance from Kroger. Investors might have been skittish following an unusually strong run on the markets this year. Even after their steep drop on Friday, Kroger’s shares are still trouncing the S&P 500 by 11 percentage points year to date—a reversal from 2020 when they trailed the market by 6.7 percentage points.

Yet another question vexing investors is whether consumers’ food-at-home habits can be sustained once there is a proper reopening. During Kroger’s just-reported quarter, when the Delta variant became the dominant Covid-19 strain in the U.S., OpenTable data shows that seated dining spiked in early June above 2019 levels, but reverted below those levels up until late August. Moreover, less than a third of workers are back in the office, according to Kastle Systems, a building security system provider. The real test may come in the coming quarters when more workers return to their offices. Many companies have shifted their back-to-office dates until after Labor Day or 2022.

But whether old shopping habits return in three months or six months really doesn’t matter much in the long run. Moreover, recent profit pressures are likely temporary. The more important fact is that Kroger’s shares are priced attractively. Despite their run this year, as a multiple of forward-12-month revenue they are still trading at a modest premium to their five-year average.

Predicting when a true reopening will occur is complicated. Bagging a relative bargain in the supermarket business isn’t.

Write to Jinjoo Lee at jinjoo.lee@wsj.com