...
I would expect them to be allowed to if they wanted.
The law allows private events to more or less to set their own rules.
We don't have the information about how participants were invited.
I've participated in a fun run, that was only open to members of the organisation that operated that event. Needless to say, it was only open to people of working age.
For instance, if it was limited to members of one specific (or a group of similar) religious establishments, then the general public would not have the option of participating.
it was just a fundraising event. I don't know what the funds were destined for.
But I would take the opportunity to draw the parallel with the government's intervention in this event, and the proposed banning of Maccabi Tel Aviv football fans.
In this event they tried to intervene because some (potential) participants were not allowed to participate, although we don't know if there were any, and their criticism was about sexism.
Whereas the government's intervention was way OTT, in supporting the presence of (potential) football hooligans in the local Tel Aviv derby, on the basis of avoiding potential riots, and the accusation was of anti Semitism.