Shares of Veeva Systems (VEEV -0.29%), which provides cloud services to life science companies, recently hit an all-time high after the company released its second-quarter earnings report. Let's examine the five main reasons Veeva attracted the bulls, and why its stock could still head higher after doubling so far this year.

1. It easily beat Wall Street's expectations

In the second quarter, Veeva's revenue rose 33% year-over-year to $353.7 million, beating expectations by $13.7 million. Within that total, its subscription revenue rose 30% to $283.5 million as its professional services and other revenue grew 42% to $70.2 million.

Digital icons for healthcare services.

Image source: Getty Images.

Demand for Veeva's cloud services -- which help drugmakers and healthcare companies manage customer relationships, track clinical trials and regulations, and store and analyze data -- have continued rising throughout the COVID-19 pandemic. The strength of those core services easily offset the pandemic's impact on its newly acquired Physicians World and Crossix segments, which both rely on in-person meetings and events.

Veeva's GAAP net income rose 18% year-over-year to $93.6 million in the most recent quarter. On a non-GAAP (adjusted) basis, its net income increased 33% to $116.4 million, or $0.72 per share, which cleared analysts' expectations by $0.08.

Unlike many other high-growth cloud companies, Veeva remains firmly profitable for three reasons: Its first-mover's advantage grants it plenty of pricing power, it doesn't face any meaningful competitors, and it's constantly locking in customers with new services.

2. Its operating margins are expanding

Veeva's earnings beat was also supported by its adjusted operating margin, which expanded 200 basis points year-over-year to 40.8%. Lower expenses for travel and customer events throughout the pandemic accounted for 250 basis points of that expansion.

A doctor wearing smart glasses checks a patient's digital record.

Image source: Getty Images.

Veeva expects its adjusted operating margin to dip to 38.5% (at the midpoint) in the third quarter, which marks a decline from 39.7% a year ago. But that contraction isn't surprising, since its travel expenses will likely rise again as pandemic restrictions ease.

But for the full fiscal year, Veeva expects its adjusted operating margin to hit 38.3% (at the midpoint), up from 37.3% in 2020, 35.6% in 2019, and 30.9% in 2018. Those expanding margins indicate Veeva's management has an iron grip on balancing long-term growth and spending.

3. It raised its full-year guidance

Back in May, Veeva estimated its revenue would rise 25%-26% in fiscal 2021, and its adjusted earnings would grow 14%-16%.

However, Veeva raised that guidance in the second quarter: It now expects its full-year revenue to rise 28%-29% and for its adjusted earnings to grow 21%-22%. It also raised its full-year operating cash flow forecast, which excludes a one-time tax benefit, from $450 million to $475 million.

During the conference call with analysts, Veeva CFO Tim Cabral attributed that rosier guidance to the "improving environment for our customers and continued growing demand for our products and services."

4. It anticipates $3 billion in revenue by 2025

Veeva expects to generate about $1.4 billion in revenue this year, but it reiterated its goal of generating $3 billion in annual revenue by fiscal 2025. That long-term forecast suggests Veeva's revenue will grow at an average rate of more than 20% over the next five years.

If Veeva steadily marches toward that goal as it expands its operating margins, its earnings could more than double by 2025. Therefore, Veeva's stock might seem pricey today at over 100 times forward earnings estimates, but that multiple could gradually contract as its profits rise.

5. Cloud stocks are becoming defensive investments

Veeva's co-founder and CEO, Peter Gassner, was previously salesforce.com's senior vice president of technology, and its platform is still powered by Salesforce's cloud services. Like Salesforce -- which recently posted record earnings and operating margins while raising its full-year guidance -- Veeva is riding high on the secular growth of the cloud services market.

The trade war, COVID-19, and other macro headwinds slammed many sectors over the past year, but top cloud stocks like Veeva and Salesforce remain well-insulated from those challenges. Those strengths make them good defensive stocks in this volatile market, even as their stocks hit record-high prices and valuations.

My key takeaway

I started a new position in Veeva in mid-August, and its second-quarter report indicates I was right to buy the stock near its all-time highs. Its robust revenue and earnings growth, expanding margins, wide moat, and sticky ecosystem all indicate it still has plenty of room to run.