Imam Ibn Hajar Al Asaqalani says in Fath AlSaheeh Muslim
Book 019, Hadith Number 4321.
Chapter : Permissibility of killing women and children in the night raids, provided it is not deliberate.
It is reported on the authority of Sa'b b. Jaththama that the Prophet of Allah (may peace be upon him), when asked about the women and children of the polytheists being killed during the night raid, said: They are from them.
There are many possible meanings for these Hadith. I was kind of surprised when I read it at first. But we don’t know the EXACT situation or what the Prophet truly meant. Maybe, maybe THOSE particular women and children were planning to fight against the Muslims with the enemy.
Maybe the Muslim army just could not have blown this chance to attack the enemy that they still had to attack them no matter at what cost in order to stop the risk of more blood shed (do a little bad for the greater good).
The very fact that the companions of the Prophet asked the Prophet's permission shows that the Prophet used to be strict regarding his prohibition on the killing of women and children. However, when a situation arises and there is no choice, things could get ugly. The Prophet even forbade the cutting down of palm trees in war, however during the siege of Banu Nadir the Prophet had to make an exception. So exceptions do arise unfortunately.- Baari that the point is not to target the women and children intentionally but if there is absolutely no other way to kill the enemy than by injuring the women and children because they are mixed with the men then there is no other choice. (Source: http://hadith.al-islam.com/Display/D...Doc=0&Rec=4747
Another possibility is that the hadith has been abrogated and that even if women and children accompany the enemy during war then they still should not be killed. (See http://hadith.al-islam.com/Display/D...Doc=0&Rec=4747
for the evidence)
Imam Nawawi says in his tafseer of Saheeh Muslim that women and children are only killed only if they cannot be distinguished. But because it was so dark and they could not be distinguished, the Muslims had not choice. (Source: http://hadith.al-islam.com/Display/D...Doc=1&Rec=4215