It was a mutually exclusive deal. The women must cover herself in front of men, to stop any temptation, and at home, she is free to dress as she wishes. These days though, that has been taken totally out of context, and had religious views stamped all over it.
Sadly, this isn't restricted purely just to Middle-Eastern Societies, but it is more prevalent due to the media coverage. Over here, we allow women to dress as they please, and rape cases are higher here, then they are in the Middle East. Now, I'm not saying they've got a good system, but merely pointing out, they had an old system (and I am talking, hundreds, if not thousands of years by the way) that ensured that both Men & Women were safe and could lead happy lives.