I have seen multiple questions on this site that mention how when a dividend is paid out, the price of stock drops by the same amount, which makes it so that getting the dividend does not actually amount to profit for the shareholder.
And aside from having the same net worth the day before and the day after the dividend is paid; you have to pay taxes on the dividend; as well as not having it automatically re-invested as regular stock growth would be.
Given that, why would you ever want a dividend? Certainly there's a "feeling" of getting regular income from the stock; but you couldn't get that same regular income from a non-dividend stock by selling a small portion of the stock at regular intervals? As far as I understand, the math on this should work out the same as getting a dividend in regards to how much your stock holdings are worth afterwords.
Are there any financial advantages to having a stock that pays dividends? If not, why do some companies bother doing it; and why don't people avoid the stocks that do it?