Corbyn's both a long-standing leftist, and rather old. The left long opposed the EU, and clearly that's going to be more deeply embedded in a (literally) old leftist. Generation does seem to be a big factor in attitudes to the EU.
I mean in the first referendum all the Tory papers now demanding leave were campaigning to stay in.
This whole thing has been a series of slow-motion car-crashes which all happened to coincide.
Everything came together at the wrong time - idiot public schoolboy dilettantes in charge of the Tory party (mainly interested in continuing ego battles between them), the awful idea that was the Euro, the financial crash, the Syrian refugee crisis, and an old-school leftist, with an old-school-leftist attitude to the EU, finally getting to the top of the Labour Party at what might in some ways be just the wrong moment.
I think maybe if any one of those ingredients had been missing this wouldn't be happening.