The hadith does not say that women are literally devils, nor that a woman is sinful merely for appearing in public. It uses vivid language for the effect that unexpected attraction can have on a man, while directing the man himself to act responsibly and lawfully.
Why the wording troubles critics
The strongest objection is understandable. The report describes the Prophet Muhammad (PBUH) seeing a woman, experiencing desire, going to his wife Zaynab, and then telling his Companions that a woman "advances and retires in the shape of a devil." Read as a statement about women's nature, this sounds like demonization. Read as a moral lesson, it may also seem to place responsibility for male arousal on a woman who has done nothing wrong.
That reading would be a serious problem if it were what the hadith meant. But the wording and the wider teaching do not require it.
What "in the shape of a devil" means
"A woman advances in the form of a devil and retires in the form of a devil. When one of you sees a woman and she attracts him, he should go to his wife, for that will repel what he feels."
Sahih Muslim 1403
This is a comparison of effect, not a claim about essence. The Arabic expression likens the way temptation approaches and departs to the way Satan incites a person. Classical commentators, including al-Nawawi, understood the point as the sexual temptation that may arise in the observer, not that women are devils or morally corrupt.
Arabic and other languages often use "devilish" metaphorically for something that provokes temptation or distraction. The hadith itself explains the comparison: it speaks about what happens in the man's heart and tells him what he should do next. It does not accuse the woman of a crime, say that she deliberately tempted him, or permit him to mistreat her.
The man is given responsibility
The Quran begins its instruction about sexual modesty by addressing men:
"Tell the believing men to lower their gaze and guard their chastity. That is purer for them. Indeed, Allah is aware of what they do."
Quran 24:30
Attraction itself can arise involuntarily; moral responsibility concerns what a person chooses to do with it. The Prophet's (PBUH) instruction is therefore practical: do not feed the glance or pursue an unlawful fantasy; turn instead to one's lawful spouse. His going to Zaynab was not a failure to control himself. It demonstrated that desire should be handled through a lawful and dignified means.
What the hadith does and does not establish
It does not establish that womanhood is evil, that women must never appear in public, or that men may blame women for their own misconduct. It does establish that sexual attraction can be powerful, that men must discipline their response, and that marriage provides a lawful outlet. One may prefer less figurative wording, but the text itself is a warning about temptation, not a verdict against women.