it's illegal for the unmarried..Marriage turns them to the 'Legal' state.Islam is a religion that does not avoid human' nature but it tries to understand them. Humans can't control they desires,that is why we don't use the 'nun-concept' as they lead to misbehaviour and destruction of harmony in a state(like rapes,molests)..man who can't afford mariage are adviced by our prophet to fast so they will be under control and in patience.