The S&P stayed largely in balance in 2015, finishing the year little-changed. Photo: Flickr user Hans Splinter.

The S&P 500 (^GSPC -0.58%) largely disappointed investors in 2015, closing at 2,044 and finishing the year down less than 1% from where it started. Yet even though investors never like to see major market indexes lose ground, the fact that the S&P held up as well as it did was actually cause for celebration. Let's take a look at some of the challenges that the S&P 500 had to overcome to keep its losses in check during 2015.

Weakness in commodities
The worst-performing sectors in the S&P 500 in 2015 were energy and materials, with reasons that are obvious to anyone who has followed the markets at all during the year. Plunging crude oil prices added to already existing pressure in the natural gas market to create substantial losses among energy stocks, with the sector losing about 23% as a result. The worst performer in the S&P 500 was Chesapeake Energy (CHKA.Q), which just barely beat out other players in the energy space with a nearly 77% loss. Even larger declines came to smaller energy stocks outside the S&P 500, as the impact of falling prices on companies with more limited financial resources was even harsher.

Similarly, materials stocks fell about 10% as prices of both precious metals and base metals remained under pressure throughout most of the year. With demand for raw materials from global manufacturers having slumped because of the sluggish economies of many important markets around the world, mining and metals companies had to take drastic cost-cutting steps to remain profitable. Indeed, S&P 500 component Freeport-McMoRan (FCX 0.83%) fell 70% as it gave investors the worst of both worlds: exposure both to energy and to materials.

Earnings growth disappears
Investors in the S&P 500 have had to endure something in 2015 that they haven't seen since 2009: persistent weakness in corporate profits. During the second and third quarters of 2015, the S&P 500 posted year-over-year declines in earnings, and as of the end of the year, analysts expected another round of falling earnings when companies report their fourth-quarter results toward the beginning of 2016. If the S&P does in fact post a three-quarter consecutive streak of falling earnings, it would be the first time it has done so in six years.

It's easy to blame energy and materials for the overall declines, given that energy-industry earnings fell by more than half in the third quarter and materials earnings declined more than 15%. Yet several other sectors, including industrials, consumer staples, and utilities, saw earnings shrink in the third quarter. As the economic malaise spreads across sectors, the chances of a longer-term corporate-earnings recession grow more likely.

New entrants to the S&P 500
It's always interesting to see what up-and-coming companies gain admission to the S&P 500's ranks. In 2015, some well-known stocks found themselves on the list.

American Airlines Group (AAL 6.60%) joined the S&P 500 in March, marking a watershed event not just for the company that had just emerged from bankruptcy protection in late 2013 but also for the airline industry as a whole. For a long time, most of the traditional carriers had had trouble making their way into the index, as a lack of profitability and frequent bankruptcy filings left investors unwilling to bid up their market capitalizations particularly far.

That changed in 2013, as rising profits across the industry finally convinced investors that the fundamentals of the business had changed. Slowly but surely, airlines have entered the S&P, and American in particular was noteworthy given just how recently the carrier has recovered from its financial challenges to thrive.

Also, PayPal (PYPL -0.27%) joined the S&P 500 in July after it officially spun off from parent company eBay and became a separate publicly traded stock. The payments company has been a driving force in eBay's success in recent years as it works to boost its presence in the rapidly growing electronic payments industry. With a loyal customer base already familiar with the product, PayPal is in position to keep climbing from its already attractive position.

The S&P 500 didn't give investors very good performance in 2015, but it wasn't a catastrophic year for the index either. With such disparate performance across sectors and signs of continued weakness in earnings, it's entirely possible that 2016 will present as many challenges for the S&P 500 as 2015 did.