There are (at least) two general points to consider. First, hang gliders are ultralights and the regulations in 14 CFR 103 apply to them. 103.17 says:
No person may operate an ultralight vehicle within Class A, Class B,
Class C, or Class D airspace or within the lateral boundaries of the
surface area of Class E airspace designated for an airport unless that
person has prior authorization from the ATC facility having
jurisdiction over that airspace.
If you look at a sectional chart, most of the airspace over NYC is class B, including to the surface in many places:

In a class B surface area ultralights require ATC's permission to operate; whether or not the area was congested is a separate issue and nothing to do with the airspace class itself.
Second, as a general statement the FAA regulates what happens in the air but not what happens on the ground. States and counties can make their own rules about launching and recovering aircraft, and national parks have their own rules too. In other words, you need to make sure that wherever you fly your hang glider, it's both legal to launch and legal to operate in that airspace.
Now, let's look at Midland Beach, Staten Island specifically. I've marked the approximate location on the chart with a red dot. It's hard to see because the chart is so crowded, but that part of the coast is depicted as a "special conservation area" and there's also a comment that it's part of the Gateway National Recreation Area, which is a national park.
The airspace there is class B from 1500ft upwards, meaning that if you stay below that altitude then you're OK from the airspace point of view. It's true that the FAA discourages flight over parks, but it's mostly about noise (not a concern in a hang glider) and there's no actual regulation anyway.
However, it seems likely that you were launching from a national park and that does require permission from whichever authority runs it. I have no idea whether or not that's what the NYPD were talking about.
(My personal suspicion is that the NYPD officers just decided "that can't be legal" and made up something on the spot. But there are still actual regulations that do apply, whether or not the officers were fully informed/trained on them or not. I also don't know why the NYPD would want to enforce FAA regulations, but that's a topic for another site.)