Corbyn was a massive Eurosceptic which was why he sat on the fence and lost an election as he couldn't be strong enough to say what he believed.
Cameron didn't want to leave the EU and did everything to keep us in. He had to have the referendum as it was in their election manifesto. He even resigned straight after the vote as he'd failed to keep us in the EU.