Because they thought they were going to win!
Cameron had won against the Scots (Indy1), got a Tory majority in GE and was going for the treble; but he made some 'rotation' moves, they came off badly, the manager walked, that's the real story of Brexit referendum.
They did win, Tories have a bigger majority than for a long time, they even contrived to get the red wall voting for them and now they've got everyone waving flags from both sides plus a totally useless (again) opposition leader .
They knew Brexit would be disastrous but didn't care, they knew the electorate was so gullible they were in no danger. Pigs in clover.
Five years later and the public are still being fooled. It was as clear as day about the trade problems, about the NI problems about all the problems, nobody wanted to listen and they still won't admit, now, they the public got it so wrong, they can't admit it.
Cameron was just a casualty "for the greater good." of the Tory Party
Just keep waving those flags , I'm sure everything will be fine.