Palantir's (PLTR -0.42%) stock price has nearly quadrupled since its direct listing last September. The data mining firm attracted a stampede of bulls after it posted a strong third-quarter earnings report last November, hiked its full-year revenue guidance, and signed new government and enterprise contracts.

But Palantir's meteoric rise has also raised red flags. At $36 a share, the stock trades at nearly 50 times next year's sales, making it one of the market's priciest tech stocks. Its lock-up period will also expire after its upcoming fourth-quarter earnings report, and a lot of insiders could be eager to cash out.

Palantir still isn't profitable, and some of its U.S. government contracts -- especially one with Immigration and Customs Enforcement (ICE) to track undocumented immigrants -- are controversial. But despite all these fears, I believe Palantir remains a compelling investment, for three simple reasons.

A man looks at a cloud of data.

Image source: Getty Images.

1. Sticky government contracts

In its prospectus, Palantir claims it will become the "default operating system for data across the U.S. government." Its Gotham platform, which mainly serves government clients, already helps the U.S. military, FBI, CIA, and other government agencies make data-driven decisions.

Palantir's revenue from government customers rose 73% year over year to $420.3 million, or 55% of its top line, in the first nine months of 2020. During the third quarter, it secured a new AI contract with the U.S. Army.

Last December the U.S. Army renewed the second year of a four-year analytics partnership (which provided for one base year and three optional years) with Palantir. That same month, the Food and Drug Administration (FDA), which already uses some of Gotham's tools, awarded Palantir a new three-year contract to track the development of new drugs.

In January, the U.S. Army hired Palantir to modernize its ground stations. This contract, which will start with a prototype and expand over four phases, could be worth up to $250 million.

These contracts all indicate Gotham is sticky, and will allow Palantir to deploy additional services to boost its average revenue per customer and widen its moat against its potential challengers.

2. Growth potential in the enterprise market

Palantir also helps enterprise customers process data with its Foundry platform. The Wall Street bears often claim Foundry faces too much competition in the enterprise analytics market, but Palantir's enterprise revenue still rose 30% year over year to $320.3 million, or 45% of its top line, in the first nine months of 2020.

A medical professional accesses data on a tablet.

Image source: Getty Images.

During the third quarter, Foundry signed a new contract with the National Institutes of Health, renewed a contract with a big aerospace customer, and pulled a "major" consumer goods company away from an unnamed rival.

Last December, it signed a new two-year Foundry contract with the U.K. National Health Service (NHS) to track COVID-19 infections. Throughout January and February, it expanded its Foundry deals with Fujitsu and BP (BP -0.14%), while signing new contracts with PG&E (PCG 1.39%), Rio Tinto (RIO 0.33%), and IBM (IBM 0.49%).

These deals indicate Foundry's tools can be applied to a wide range of industries -- including energy management services for PG&E and BP, optimizing mining operations for Rio Tinto, or optimizing AI tools for IBM -- and will likely keep growing after Gotham's growth slows down.

3. It's a great artificial intelligence play

The global AI market could still grow at a compound annual growth rate of 42.2% between 2020 and 2027, according to Grand View Research, as AI tools are increasingly used to process data across a wide range of industries.

That secular trend will light a fire under companies like Palantir that process large amounts of data into actionable strategies. Those tailwinds could help Palantir generate high double-digit sales growth over the next decade, and help its stock grow into its premium valuation.

Keep your eye on its long-term goals

Palantir's stock could dip over the next few months as investors take some profits amid concerns about its high valuation and lock-up expiration. However, those declines could be great opportunities for long-term investors who are willing to tune out the noise for a few years.