Palantir Technologies' (PLTR -0.23%) stock took investors on a wild ride after it went public via a direct listing on Sept. 30, 2020. The data-mining firm's shares started trading at $10, closed at an all-time high of $39 last January, but subsequently tumbled all the way back to about $12 a share.

Does that pullback represent a good buying opportunity for patient investors? Let's review the bull and bear cases to decide.

A soldier plans a mission on a laptop.

Image source: Getty Images.

What does Palantir do?

Palantir operates two main software platforms: Gotham, which serves government clients; and Foundry, which serves large enterprises and private organizations. A third platform, Apollo, provides automatic software updates for both platforms as a cloud-based service.

Palantir's software aggregates data from disparate sources and then analyzes it with artificial intelligence algorithms to help organizations make informed decisions. For example, the U.S. Army uses Gotham to collect intel from various government agencies and local sources to plan missions. Large companies can also use its algorithms to streamline their operations.

Why do the bulls love Palantir?

The bulls love Palantir because it has firm ties to the U.S. government, it generates robust growth, and its gross margins are expanding.

Palantir's revenue rose 47% in 2020, then grew 41% to $1.54 billion in 2021. It ended 2021 with a high dollar-based net retention rate of 131%, and it expects its revenue to grow by at least 30% annually through 2025.

Its government revenue in 2021 rose 34% to $645 million, but it still decelerated from its 77% growth in 2020. However, its commercial revenue in 2021 increased 47% to $897 million, which accelerated from its 22% growth in 2020.

The acceleration of its commercial business silenced the bears who initially claimed Palantir would struggle against similar data-mining companies like C3.aiAlteryx, and Salesforce in the crowded enterprise analytics market.

The bulls also believe its government slowdown is temporary since it still secured plenty of new deals over the past year. In addition, Russia's invasion of Ukraine could generate fresh tailwinds for Gotham as more government agencies upgrade their analytics systems to counter the threat of new cyberattacks and military aggression across Europe.

Palantir's adjusted gross margin rose from 71% in 2019 to 81% in 2020, then increased to 82% in 2021. That ongoing expansion indicates it still has plenty of pricing power in the data mining and analytics market.

Why do the bears hate Palantir?

The bears dislike Palantir because it faces a hidden competitor within the U.S. government, it's unprofitable, and its stock still isn't cheap.

Palantir has a controversial reputation because its co-founder Peter Thiel was a vocal supporter of former President Donald Trump. Immigration and Customs Enforcement's (ICE) usage of Gotham to deport undocumented immigrants also sparked internal protests and resignations across the company.

Those controversies, along with long-term cost concerns, have reportedly driven ICE to develop its own internal replacement for Gotham called RAVEn. If other U.S. government agencies follow ICE's lead, Palantir's dream of becoming the "default operating system for data across the U.S. government" (which it boldly set in its S-1 filing) could quickly end.

Palantir's net loss widened from $580 million in 2019 to $1.17 billion in 2020, partly due to the costs of its direct listing, and narrowed to $520 million in 2021. That red ink makes Palantir a risky stock to own as interest rates rise.

Palantir's stock has nearly taken a round trip back to its initial opening price, but it still isn't undervalued at 12 times this year's sales. By comparison, Twilio (TWLO 1.08%) -- the cloud-based communications company which expects to generate at least 30% organic revenue growth over the next few years -- trades at just six times this year's sales.

To make matter worse, Palantir continues to dilute its shares with its generous stock-based compensation (50% of its revenue in 2021) as its insiders cash out. On a weighted-average basis, Palantir's outstanding shares nearly doubled in 2021. Yet over the past three months, its insiders sold more than twice as many shares as they purchased.

The bears still have the upper hand

Palantir's business should continue to grow at an impressive clip this year, but its ongoing losses, dilution, and insider sales indicate its stock could still drop even further in this challenging market. Therefore, I believe investors should avoid Palantir until its price-to-sales ratio drops to the single digits.