This line is from chapter four of Book I in "Les Miserables," the words of Monsier Charles Francois-Bienvenu Myrial, Bishop of D-. Hugo describes him as "having a strange and peculiar way of judging things. I suspect that he acquired it from the Gospel." The bishop is described further as being "indulgent towards women, and towards the poor, upon whom the weight of society falls most heavily," and he says that the faults of these people
are the faults of their husbands, fathers, and masters, of the strong, the rich, and the wise.
The bishop continues to say
Teach the ignorant as much as you can; society is culpable in not providing instruction for all, and it must answer for the night which it produces. If the soul is left in darkness, sins will be committed. The guilty one is not he who commits the sin, but he who causes the darkness
The "darkness," then is the lack of instruction and its resulting knowledge which can lead people to do the right thing. Much like Charles Dickens, an English contemporary of his, Victor Hugo felt that society itself was at times a prison. He felt that he must expose the "degradation of man by poverty, the ruin of woman by starvation and the dwarfing of children by physical and spiritual night..."
In "Les Miserables," Jean Valjean, released from prison with a yellow identification card, seeks work. However, he cannot find any since he is rejected as soon as he shows his card. After the bishop takes the wretched Valjean in for the night, the ex-criminal steals the silver candlesticks of the bishop. Realizing that Valjean has stolen out of desperation and the "darkness" of his soul, the bishop tells the police that he has given these candlesticks to Valjean. Thus, the bishop takes Valjean out of the "darkness" and teaches him the lesson of love that Jean Valjean never forgets.
This refers to the people in life that create misery for others, misery that drives normal people to do bad things. While everyone does have the agency to choose to bad things or not, and hence are guilty, there are people who have power, money, and the ability to make life better for others, who do not. These more "powerful" people instead create poverty, illness, dependency, and yes, criminals because they turn a blind eye to suffering in the world-or worse yet, create suffering because of their greed. Many people in France during the time period that this was set were in a state of severe poverty because of the extreme taxes placed on them; Valjean was one of these, and because of his poverty-not because he was an evil man at heart-stole bread and silver. The darkness was caused by corrupt royalty instituting horrific taxes, and not doing what they should to better the circumstances of the people. So, the quote is saying that the "criminals" (the poor who rob to eat, etc.) are not guilty because it was others who created the poverty.