Biologically, sexual deprivation leads to increased testosterone levels that may provoke reckless sexual behavior until sexual release happens if said deprivation reaches a certain level. Males have more testosterone so sexual deprivation happens more quickly for them - it's also the reason why males, especially males in adolescence who are going through a sudden upspike in testosterone levels, tend to masturbate more often. The sexual deprivation > testosterone increase > sexually assertive behavior (reckless if the previous factors are beyond a certain threshold) line happens in females, too, but less frequently due to the lower average level of testosterone. (In the short-term, women are actually more sensitive to testosterone upspikes when they do happen due to them having lower levels of it, but the long-term is more relevant in terms of the correlation). So from the base level, it is reasonable to see higher probability of danger of sexually reckless behavior in males than females, especially so when you take into account that males, on average, tend to have more body strength than females.
It's obviously not the case that all men are sexually deprived. It's also not such that all sexually deprived males display reckless sexual behavior, their self-control ability and whether they have the moral views to practice that self-control are relevant, as is whether this sort of behavior faces ramifications in the society that male lives in that he may want to avoid. (For example, the percentages of answers indicating avoidance would be far higher in some parts of Turkey than they would be in other parts of Turkey, because of this reason. Mostly related to victim blaming and sexually repressive moral attitudes.) Night time is dangerous for two reasons: 1) Alcoholics, drug addicts and people who otherwise engage in things that result in diminished self-restraint are usually up to their shenanigans at night. 2) There are fewer people out there in the public that would provide immediate ramifications against such actions, whether it be actively getting involved, or just being there as a witness who may testify.
The sentiment would be sexual prejudice if all the qualifiers and considerations I just mentioned went out of the window and this was made to be a general criticism of men - and outright sexual discrimination if anyone actually campaigned to get men off the streets or whatever. It's neither "men are dangerous and women live in anxiety when they are around" or "men are benign and women have nothing to be afraid of." It's much more complicated than that, and this is part of the reason why I detest rhetoric that approaches it in generalities without the qualifiers, whatever direction it may be.