The stock market used to reward companies for beating Wall Street analysts’ expectations of how much they could earn. That may be changing.

So far this quarter, through Wednesday morning, 161 companies in the S&P 500 that have announced better-than-expected earnings have had their stock price pounded down anyway, according to John Butters, senior earnings analyst at FactSet. From two days before the earnings announcement through the second day afterward, their shares have averaged a 5.5% loss.

Among...