It seems that, to me, both backgrounds and free will matter.
To take a rather extreme example: Adolf Hitler. What if young Hitler's mother hadn't tragically died of sudden, painful cancer when he was in a child in circumstances that appeared to completely disprove her positive views on life (calm, compassionate, and kind) and completely vindicate the negative views on life of his other relatives (that it's all survival of the fittest)? What if, after being utterly shattered, he hadn't had his identity morphed by a horrid atmosphere of militarism and prejudice contaminating him due to family and neighbors? What if his dreams as a young adult got fulfilled in terms of creative work instead of being quashed? What if he hadn't fought for a losing military in a devastating yet pointless war?
It's all important. At the same time, no God of Fate forced him to join the budding Nazi Party. Nobody made him decide to adopt his ideology and achieve his aims. He was put into a terrible position, and he freely chose to not just wallow in it but use his hurt in order to harm others.
I think that the situation of somebody such as, say, Sandy Hook shooter Adam Lanza, who suffered from especially severe autism to the point that normal human interaction wasn't possible for him... it's comparable. One regrets that he certainly had the background he had, facing the isolation that he did. At the same time, it still all boils down to this: choices. Nobody put a gun in his hand. He did that to himself.