I have a friend who is a solicitor who has a large local criminal practice. He is no bleeding heart liberal, his expressed opinion is that a lot of his clients are little scrotes, but someone has to defend them (it's the law), so it may as well be him. One interesting thing that he says is that a large proportion of his clients are too stupid (IQ in single figures stupid) or f*cked up to stay out of trouble. My interpetation of the post is that is the proportion that the magistrate is talking about.
Don't forget, this magistrate is dealing with them day in and day out, and he does differentiate between the evil and the stupid. Personally, I think that there is more chance of justice being served by someone with that attitude than someone who presumes that if the police have arrested them they must be guilty, and give them the maximum to boot.
From how I read it he means that magistrates, judges and other persons have who work within the criminal justice system have a huge responsibility in that they can withdraw a persons liberty as a punishment for committing crime.
Unfortunately your average prisoner (i exclude persons who don't pay their council tax and the occasional one off first offence jailing) has committed literally hundreds of crimes of various nature and severity before even seeing the inside of a prison, let alone staying there for any length of time. They know perfectly well what they are doing, even the thickest of them know what's right and wrong. Yes by and large they are a bit dim, but they also have a certain "low cunning" which constantly improves their skills in their chosen path. For example the chav car criminal who will wear about three layers of clothing so that he can remove one and make himself look different from any description passed if a witness saw them committing an offence earlier.
In nearly all criminal cases now, the CPS look at the evidence and then decide if the suspect is even charged or not before being put before the court (and the CPS usually like very solid cases before taking the risk). Then they have to be found guilty beyond all reasonable doubt before being sentenced, then would normally, in all but the most serious cases, have to have committed numerous offences before being given a custodial sentence. So I would be quite confident that most of the people in Jail over Xmas that Bystander seemed so worried about are about as guilty as a puppy sat next to a pile of poo, and that magistrates don't always take it as read that if the person in front of them has been arrested then they are guilty.
I really don't think that stupidity or ignorance of the law is an excuse.