They didn't 'lose' anything. That money was spent when they built it, ideally the rest could be written off.
Manufacturers get bitten by returns and no-sale products all the time, and often don't make their costs back, it's part of the system. Now though, they've suddenly created a webOS tablet base at least a million strong, probably 2, considering BestBuy US alone had 250,000 in stock.
That's marketshare. As they said in their shareholder meeting, they want to get out of the hardware business, and focus on software and enterprise. Creating a HP App Catalogue app and consumer base will attract licensees, making them money while keeping them out of the low margin hardware sector.