Absolutely nothing would prevent them from writing such a law, and they probably did write such, or something similar to allow for breast-feeding of babies. Check the the LeLeche League website for specific information regarding a particular state.
Most of the legislation is pretty generic and recognizes breast-feeding as a valid form of nourishment, and the mother is protected in some form or other. It varies from state to state. Again, check the website for particular information regarding your particular state.
A little disclaimer here just so we have no misunderstanding:
No, I am not affiliated with the LeLeche League. I have just found their information beneficial.