It is important to keep in mind that prisons are gender-specific. Take, for example, a man who goes to prison for being violent towards a woman. He's in jail with other men. Since he doesn't have an opportunity to rape or abuse a woman, he'll eventually be found to have good behaviour.
Prisons are gender-specific for a reason. However, it's crazy to think that putting someone in jail is going to change the attitude of a man who exhibits sexist and violent behaviour towards their wife or spouse.
In the prison environment, it isn't possible to see how these men behave towards women. The prison system can't help these men because it doesn't provide them with any education or training about violence against women. At the end of the day, people whose behaviour in prison is deemed acceptable are released into the community. That is inevitable because there are no women in their immediate environment, so they don't behave how they normally would in a different environment.