Shares of Costco Wholesale (COST -0.55%) have dipped more than 6% since reaching a new all-time high last week. A big earnings miss last Thursday caused Costco stock's recent decline.

In the wake of Costco's disappointing second-quarter earnings report, several Wall Street analysts came to the company's defense. Indeed, competition from the likes of Wal-Mart (WMT -0.65%) isn't likely to hurt Costco all that much. However, Costco stock is simply too expensive relative to its growth prospects.

A massive earnings miss

On Thursday afternoon, Costco reported that it suffered a rare year-over-year earnings decline last quarter. Earnings per share slipped to $1.17 from $1.24 a year earlier, despite a 3% gain in comparable-store sales. This fell far short of the average analyst estimate of $1.36.

The exterior of a Costco warehouse

Costco's earnings fell slightly last quarter. Image source: Costco Wholesale.

This EPS decline came despite a huge tailwind related to Costco's new credit card deal with Citibank (C 0.26%). A big advantage of the Citibank deal (implemented last June) is that it reduces Costco's credit card swipe fees almost to zero. Despite some teething pains last year, the switch to Citibank has been a success. Costco CFO Richard Galanti estimated that lower swipe fees boosted EPS by $0.16 last quarter.

However, this tailwind was more than offset by a slew of negative factors. These included lower profitability on gasoline sales, rising IT expenses, losses on currency hedges, and a slightly higher tax rate.

The sales trend remains choppy

Costco stock had soared about 10% in the month prior to its earnings report, lifted by a strong January sales report. During January, comp sales surged 7% -- or 5%, excluding the impact of rising gasoline prices and currency fluctuations. That compared to growth of just 2% for both metrics during the first four months of Costco's 2017 fiscal year.

COST Chart

Costco Stock YTD Performance. Data by YCharts.

However, comp sales growth slowed to 4% in February, or 2% on an adjusted basis. In other words, sales last month were in line with the relatively unimpressive (at least for Costco) year-to-date trend.

Galanti noted that the timing of the Chinese New Year reduced Costco's total sales in February by about 0.75%, while lifting its January sales by a similar amount. The sales trend does seem to be improving, but it isn't bouncing back as fast as some investors had hoped. The surge in Costco's stock price last month may have been built on false hope.

Maturity, not competition

Some pundits blamed Costco's slowing sales and its Q2 profit decline on rising competition from rivals like Amazon.com and Wal-Mart. Others believe that the warehouse club's core business is as healthy as ever.

The second option seems more likely. Food cost deflation has been a significant drag on sales across the grocery business recently, but that trend will eventually be reversed. Meanwhile, Costco continues to record steady traffic gains. That's a better measure of underlying consumer behavior.

Furthermore, Costco remains unique in the retail industry. Price competition between Wal-Mart and traditional grocers will have a limited impact on consumers' bulk-buying decisions.

Of course, Costco does face some competition in the warehouse club business, mainly from Wal-Mart subsidiary Sam's Club. However, Sam's Club hasn't exactly been thriving lately. Its domestic comp sales -- excluding the impact of fuel-price swings -- rose just 1.1% last year and 0.4% in the prior year. Sam's Club has also struggled to move beyond Wal-Mart's core low- to moderate-income demographic, whereas Costco members tend to be relatively affluent.

The exterior of a Sam's Club warehouse

Sam's Club hasn't performed as well as Costco Wholesale in recent years. Image source: Wal-Mart.

But the valuation is too high

While there's no reason to believe that Costco's business is in trouble, Costco shares are still too expensive to be attractive. Even after its recent decline, Costco stock trades for a lofty 26 times forward earnings. That estimate includes the full benefit of the new Citibank card relationship and more than half of the benefit from Costco's upcoming membership fee increase.

Investors are now realizing that falling gasoline prices -- and rising gasoline profits -- had a significant positive impact on Costco's profitability for much of the past two and a half years. Now, the gasoline business is returning to its historical level of profitability, and it will probably stay there (on average) going forward.

Looking beyond 2018, Costco can probably grow EPS at a high single-digit rate based on a pattern of steady expansion and low-mid single-digit comp sales gains. However, that's not enough to justify paying 26 times forward earnings for Costco stock. Unless the stock price comes down significantly, I'm going to stay on the sidelines.