There are a few places where it is explicitly illegal for women to expose their nipples. In other places indecent or obscene exposure isn't specified according to which parts can or can't be shown, leaving it up to the judge to make the decision. In other places (such as where I live) indecent exposure is defined as relating to the "genitalia", but women fear being arrested under "disorderly conduct" laws.
But the main reason is a cultural belief that it is illegal or indecent even in places where it isn't illegal. And there is insufficient actual practical challenge to this belief.
It would require laws which explicitly state that it isn't illegal to show the nipple in public, not just for breast-feeding, but in all circumstances. Then it requires women actually going topless in public, and if challenged pointing out that it is perfectly legal. So that more and more women became comfortable going topless, until people got used to seeing the female nipple.
It is more often other women who object to a woman's breast being visible. Some women will object to women breast-feeding in public even though it is perfectly legal.