Water quality and beach quality in general improve the farther east you go. Personally I don’t care for any of the beaches west of Fire Island on the LI side or north of Spring Lake on the NJ side.
I'm not really familiar with those areas (west of Fire Island / north of Spring Lake), but you are correct that water quality improves the farther east you go. It's just common sense to avoid beaches/water near NYC. I spent most of my younger beach days on eastern Connecticut and Rhode Island beaches.