A serial flasher has avoided a prison sentence despite breaching a court order forbidding him from approaching women.