What do you mean by "accountable"?
If you believe in a Christian god, then you probably believe that everyone is responsible for their actions and will be held accountable for those actions by God when they die. If, on the other hand, you subscribe to determinism, you might believe, as you suggest, that we are not responsible for our actions.
On a practical level, however, people are sometimes punished (held accountable) for things they might not even be responsible for. The argument is that the state needs to make an example out of people in order to discourage other people from engaging in illegal or reckless behavior.
According to this argument, people are expected to follow laws, molecular biology be damned. If you break the laws, the state holds you accountable.
People may also be punished in order to placate victims, or give them a sense of closure.
Taking it to an extreme, we also have scapegoating, where people who may be completely innocent are punished in order to divert attention from the real culprits.
So it boils down to a tug of war between morality and utilitarianism.
Then again, you asked "How," while I essentially answered "Why," so maybe I missed the gist of your question.