I used to think that David Cameron was secretly trying to engineer a Leave vote. There were so many signs, e.g., (1) making demands from the EU that could never be met, (2) disenfranchising EU citizens and long-term British residents in Europe, (3) holding the referendum just after the Scottish, Welsh and Northern Irish elections (leading to a lot of election fatigue in these areas), and (4) also holding it during Euro 2016 (when national pride is always running high).
However, the way he didn’t do any Brexit contingency planning and simply threw in the towel now makes it clear that he just was naïve and arrogant enough to think that he’d achieve a Remain vote no matter what.
I’ve even seen it mentioned that he bragged to Juncker that he was going to achieve a 70% win for Remain, which was clearly delusional.
Never attribute to malice that which is adequately explained by stupidity!