As we can, I think, rule out the possibility that women were actually possessed by demons, we should consider how the ideology of gender in the early modern period led to accusations of witchcraft and demonic possession.
First, there was the issue of folk medicine. Although there were university-trained doctors in the late middle ages and early modern period, they were few in number and their services only affordable by the very wealthy. Most ordinary people would have had access only to "empirics" or practitioners of folk medicine. These practitioners included midwives who as well as their primary duty of helping women in childbirth might be the only medical experts in a village. Another category of folk medical practitioners were herbalists or "wise women". While these practitioners were not acquainted with astrological theories of medicine or the writings of Galen common in the universities, their practical knowledge of herbal cures was probably as or more effective than the common medical practices of the period. Often they were practitioners of folk religion as well. Because they were outside the established male hierarchies of church and university medicine, they were sometimes perceived as a threat to the established social order and condemned as witches.
Similarly, accusations of demonic possession were often used as modes of suppressing powerful women (e.g. Joan of Arc) and discouraging women from rebelling against gender oppression.