Twilio (TWLO -0.55%) shareholders have had a brutal 2022, with the stock falling 81% this year. Several factors caused its tumble, but many investors want to know if the stock is worth holding on to.

Twilio's business is still executing at a high level, despite what the stock movement indicates. While growth may be slowing in the short term, the long-term vision for the company remains intact. Let's find out why there is such a disconnect between the business and the stock.

How Twilio got to its lows

Twilio's stock problems primarily come from sentiment change, but there are multiple reasons why the conversation around Twilio's business has turned negative. At the beginning of the year, Twilio's stock traded for more than 15 times sales. A company that commands that valuation level often has top-tier margins and blazing fast growth. Twilio's growth was solid, with organic revenue rising 34% in the fourth quarter of 2021, but Twilio has never produced a cent of profits as a public company.

Even though Twilio is a higher-margin software company, its gross margins are much lower than many of its peers' because it has to pay telephone service providers. This combination made Twilio's stock overvalued, and the stock tumbled.

However, that still doesn't get us to where Twilio is today. During its Q3 earnings report, Twilio management revoked its promise to grow its organic revenue by 30% annually through 2024. This guidance was a large part of the investment thesis, and without it, Twilio's shareholders ran for the hills, with the stock plummeting more than 30% the day after the earnings report.

Twilio's stock is now at the same price as in June 2018 when its trailing-12-month revenue was $440 million. For reference, Twilio's current 12-month trailing revenue is $3.6 billion, a 718% increase.

Because of its rising sales, Twilio's valuation is now at an all-time low.

TWLO PS Ratio Chart

TWLO PS Ratio data by YCharts

A price-to-sales ratio of 2.7 is a level rarely seen by tech companies. And I think it's the main reason to buy or hold the stock.

Twilio is undervalued compared to a similar gross-margin software company

Let's be clear: The primary reason for Twilio's absurdly low valuation is sentiment change. The company is still growing, with Q4 revenue expected to be about $1 billion, representing about 19% growth. Wall Street analysts also expect Twilio to grow its sales by 18% next year. It is also committed to reaching non-GAAP operating profitability in 2023 and will continue making the business more efficient in the coming years.

With the business growing slower but still at a solid rate, it begs the question: What's a reasonable valuation for Twilio? It might help to find a lower gross-margin software business, like Tyler Technologies (TYL 0.03%).

Its public and government software offerings have a low gross margin -- about 42% compared to Twilio's 47%. It has also historically grown at a mid-teens rate, besides a slight bump during the pandemic, which is slightly slower than Twilio. However, where Tyler Technologies excels is its profitability, which has consistently been around the 10% mark over the past decade.

Still, Tyler Technologies trades at around 7.4 times sales versus Twilio's 2.7. I wouldn't argue that Twilio should be valued more than Tyler Technologies -- it's a top-tier performer that is profitable. However, Twilio shouldn't have a third of the valuation as Tyler Technologies solely because of its profitability.

A reasonable price-to-sales valuation for Twilio is probably around 5, indicating the stock could double based on valuation alone. It's also about where the stock traded before its most recent sell-off. However, Twilio's market opportunity is still vast, so the growth the company will experience over the coming years will also drive the stock price higher.

The market has a great reason to be disappointed in Twilio, but at today's valuation level, the stock doesn't have anywhere to go but up.