But, companies must eventually give out dividends. There's a certain point at which the company's cash hoard gets so large that investors become unhappy (see Microsoft).
Companies tend to announce buybacks when things are going well and their stock is fully priced. How many companies were announcing buybacks in December 2008 when it would have really made sense?
It's nice to own stock in a company that's currently profitable and get a share of its current profits; it also makes sense to own stock in a company you expect to become profitable in the future and get a share of its future profits. Stocks can be a good investment even if they don't presently give off dividends.
Stocks that will never give off dividends are a bit different. I suppose they give you "ownership" of some portion of the company's assets, so if the price is less than the value of the current or future assets represented by a stock, that can also be a good investment.
What doesn't make sense is buying stocks that don't pay dividends, won't pay dividends, and are priced high in comparison to the company's current and expected future assets. Buying stocks in that category is like buying a house as an "investment" in 2008.
EDIT: HN user jakarta said it better a couple weeks ago: http://news.ycombinator.com/item?id=1581366