Muslim men have been ordered in Quran to lower their gaze and not look at Nin Mahram women who are not covered by proper Hijab. (Tell the believing men to lower their gaze and protect their private parts (from sinful sexual acts). That is purer for them. (Sura Noor, verse 30).
Next verse says: And tell the believing women to lower their gaze ( from looking at non Mahram men) and protect their private parts.(from sinful sexual acts).(Sura Noor, verse 31).
These orders aim preventing acts which can initiate or cause sinful sexual acts and maintaining the purity and piousness in the hearts of men and women when dealing with each other. It is a type of prevention which is better than cure. Sinful looking initiates sinful desire which can be a step towards sinful sexual act, that is why, lowering gaze has been clearly ordered in Quran and authentic Hadeeths.