It was an incongruous sight for a baseball stadium: tens of thousands of ultra-Orthodox Jewish men, all dressed in black suits and white shirts, filing through the gates of Citi Field on Sunday, wearing not blue-and-orange Mets caps but tall, big-brim black hats.

There was no ballgame scheduled, only a religious rally to discuss the dangers of the Internet.

More than 40,000 ultra-Orthodox Jews were expected to attend — a sellout in a season where the average attendance at a Mets game has been barely half that. The organizers had to rent Arthur Ashe Stadium nearby, which has 20,000 seats, to accommodate all the interested ticket buyers.

The organizers had allowed only men to buy tickets, in keeping with ultra-Orthodox tradition of separating the sexes. Viewing parties had been arranged in Orthodox neighborhoods of Brooklyn and New Jersey so that women could watch, too.

For the attendees, many of whom said they came at the instructions of their rabbis, it was a chance to hear about a moral topic considered gravely important in their community: the potential problems that can stem from access to pornography and other explicit content on the uncensored, often incendiary Web.