A state court has invalidated Binghamton's two-year moratorium on natural gas drilling, marking the first time a local law enacted to limit hydraulic fracturing in New York has been struck down.