A federal judge in Manhattan extended the temporary ban but rejected broader restrictions sought by 19 Democratic state attorneys general.