The first thing you hear as you approach Badam Bagh women’s prison in Kabul is children’s laughter. The closer you get, the more the building sounds like a kindergarten class during recess.

Over the past five years, I visited a half-dozen women’s prisons in Afghanistan and met hundreds of women who were arrested while pregnant and gave birth in prison, along with hundreds who came into the system with toddlers. Afghanistan’s prisons are filled with mothers who have been rejected by their families because they are accused of “moral crimes”: women who have been raped or fled abuse or forced marriages, women accused of adultery, unmarried women who have become pregnant with partners their families didn’t approve of. In Afghanistan, such victims of abuse are penalized instead of protected.

When a woman’s body, in Afghanistan or elsewhere, is considered the property of her father, husband, community, religion or state, any action she takes without first being given permission by the men who wield power over her becomes a threat to the authority of those men. In Afghanistan, such threats are often met with incarceration and violence. Whenever I asked a female prisoner what she would do when released, the most common response was: “I will be killed.”

The justice system in Afghanistan is a funhouse-mirror reflection of what a justice system should be. Women who run away from their homes to escape abuse or forced marriage are tracked down by the police. Victims are transformed into criminals, and the limited resources that should be used to bring perpetrators of violence against women to justice are instead spent to keep young women behind bars.

When I first began visiting women’s prisons in Afghanistan, I focused on these “moral crimes.” But as I spent hours seated on prison floors in conversation with prisoners, I met more and more women who had been incarcerated for crimes they actually did commit — such as one 20-year-old who cut the throat of the sleeping husband who forced her into prostitution, unable to withstand another day of the abuse he had inflicted on her for years. I came to realize that I needed to abandon the categories of guilty and innocent. Nearly every woman accurately accused of murder, drug or drug-related offenses said she had been physically abused or raped, or had survived extreme poverty, or had been forced into marriage and motherhood, often while still a child herself. Each of them had been denied control over the direction of her own life from girlhood.

If these women had been able to control their destinies, and had access to basic education and protection from abuse, they would have chosen different paths and would not have been in prison to tell me their stories.

In 2009, the Afghan government formulated groundbreaking legislation called the Law on the Elimination of Violence Against Women (EVAW). This law criminalized harmful practices such as rape, forced marriage, domestic violence, the sale of women and girls and the denial of the right to education and work. It was enacted by presidential decree but because of conservative resistance was never ratified by parliament. The resulting confusion about its status has made its application inconsistent at best. Without a firmly established legal framework of protection and basic human rights, Afghan women have no hope of securing gender equality or a justice system in which their rights can be defended. As the international community continues to withdraw from Afghanistan, it is urgent that the law be ratified and implemented.

But the solution is not only legal. It is also cultural. The monitoring of women for “moral crimes” perpetuates a system of marginalization and legitimized violence. If women were free to choose their intimate partners, their communities, husbands, fathers and the entire justice system would no longer be in the business of safeguarding their virginity and their bodies. So long as a woman’s body is regarded as property, gender equality — and basic human rights — cannot exist.