If you assume the market is always 100% rational and accurate and liquid, then it doesn't matter very much if a company pays dividends, other than how dividends are taxed vs. capital gains. (If the market is 100% accurate and liquid, it also doesn't really matter what stock you buy, since they are all fairly priced, other than that you want the stock to match your risk tolerance).
However, if you manage to find an undervalued company (which, as an investor, is what you are trying to do), your investment skill won't pay off much until enough other people notice the company's value, which might take a long time, and you might end up wanting to sell before it happens. But if the company pays dividends, you can, slowly, get value from your investment no matter what the market thinks. (Of course, if it's really undervalued then you would often, but not always, want to buy more of it anyway).
Also, companies must constantly decide whether to reinvest the money in themselves or pay out dividends to owners. As an owner, there are some cases in which you would prefer the company invest in itself, because you think they can do better with it then you can. However, there is a decided tendency for C level employees to be more optimistic in this regard than their owners (perhaps because even sub-market quality investments expand the empires of the executives, even when they hurt the owners).
Paying dividends is thus sometimes a sign that a company no longer has capital requirements intense enough that it makes sense to re-invest all of its profits (though having that much opportunity can be a good thing, sometimes), and/or a sign that it is willing, to some degree, to favor paying its owners over expanding the business. As a current or prospective owner, that can be desirable.
It's also worth mentioning that, since stocks paying dividends are likely not in the middle of a fast growth phase and are producing profit in excess of their capital needs, they are likely slower growth and lower risk as a class than companies without dividends. This puts them in a particular place on the risk/reward spectrum, so some investors may prefer dividend paying stocks because they match their risk profile.