Casper Sleep Inc. set out to upend the mattress industry, promising a big vision and rapid growth, with slick online marketing that cut out retail stores. But it couldn’t solve the economics of its business model and turn a profit.

This week the mattress-in-a-box maker agreed to be taken private in a transaction that values Casper at less than $300 million, about half what it was worth when it went public nearly two years ago. Casper had been valued at $1.1 billion in a private funding round in early 2019.

Casper...

Casper Sleep Inc. set out to upend the mattress industry, promising a big vision and rapid growth, with slick online marketing that cut out retail stores. But it couldn’t solve the economics of its business model and turn a profit.

This week the mattress-in-a-box maker agreed to be taken private in a transaction that values Casper at less than $300 million, about half what it was worth when it went public nearly two years ago. Casper had been valued at $1.1 billion in a private funding round in early 2019.

Casper was one of the first online brands to open its own fleet of stores and go public. Sales rose but it booked a net loss in every quarter since 2018, which includes two years before it went public and each period since its lackluster debut, according to data from S&P CapitalIQ

Its flop on Wall Street coincides with the recent successful debuts of other popular online brands. Eyeglass seller Warby Parker Inc. went public in September and sports a market value of about $6.5 billion. Footwear maker Allbirds Inc. went public this month and is worth $3 billion.

Casper Sleep went public in February 2020 with a $12 IPO pricing.

Photo: Richard B. Levine/Zuma Press

Casper is being bought by Durational Capital Management, a private equity firm that has previously invested in food companies such as Bojangles Inc. The deal is worth $6.90 a share, nearly double where Casper shares closed last week, but below the company’s $12 initial public offering price in February 2020.

After starting out in 2014 as an online seller, Casper opened dozens of its own stores and started selling its products in traditional chains like Target Corp. , which had invested in the startup.

The marketplace was flooded by dozens of internet mattress sellers, such as Purple Innovation Inc. and Nectar Sleep, driving up the competition for shoppers and the costs of online advertising to reach them. Purple recently reported that sales fell in its latest quarter, and it cut its revenue targets for the year, citing production troubles.

Meanwhile, incumbents including Serta Simmons Bedding LLC and Tempur Sealy International Inc. started selling bed-in-a-box concepts, and online retailers including Amazon.com Inc. began making their own mattresses, undercutting the others on price.

The company helped prove that consumers would buy big-ticket items sight unseen, but it also ran into the limits of ecommerce.

Photo: Yana Paskova/Getty Images

Casper posted a net loss of $80 million for the first nine months of this year, compared with a loss of $75 million in the same period last year. The wider loss came as its costs of goods jumped 38% from a year ago compared with a 26% jump in revenue.

The company said quarterly revenue for its direct-to-consumer business, which includes its roughly 70 stores, was down from the third quarter of 2019, as the company pulled back on advertising. “Frankly, that is really, really surprising because the mattress industry has seen record demand over the last 18 months,” said Peter Keith, senior analyst at Piper Sandler & Co.

Mr. Keith said the company suffered from too much overhead, and fumbled the rollout of its retail strategy. “They wanted to pull back on advertising while they executed their wholesale distribution strategy,” he said. “But cutting back on advertising negatively impacted their [direct to consumer] sales.”

Casper said its board had explored a range of strategic options over several months and determined that the deal with Durational was superior because it “offers shareholders immediate and substantial value, and ensures the business has the financial flexibility required to support continued growth.”

On Monday, Casper said co-founder

Philip Krim was stepping aside as chief executive, a role he has held since the company’s earliest days. The entrepreneur and his colleagues started the online brand inspired by the success of Warby Parker.

Casper helped prove that consumers would buy big-ticket items sight unseen. But it also ran into the limits of ecommerce. “There’s still a lot of the population that will never buy a mattress without laying on it first,” Mr. Krim said in a 2018 interview.

Casper responded to increasing online advertising costs with plans to open its own stores. As competition grew stiff among mattress startups, Casper intended to move from a brand known for its mattresses-in-a-box to a place to buy all types of sleep products.

The takeover by Durational must be approved by Casper shareholders. Casper said executives, directors and other investors who collectively own or control around 28% of the stock have agreed to vote in favor of the transaction.

Write to Charity L. Scott at Charity.Scott@wsj.com and Khadeeja Safdar at khadeeja.safdar@wsj.com