The missing piece here is that the referendum was designed by people who wanted and expected remain to win. David Cameron, the PM at the time, was facing a minor rebellion within his own party from a faction of MPs that were anti-EU. They weren't a majority of the party, but they were large enough to cause trouble.
A couple years prior, he had faced a similar problem from Scottish nationalists, so he approved a referendum on Scottish independence. He was against independence, but when Scotland voted to remain a part of the UK, it weakened the arguments of the Scottish nationalists, making his job easier. He figured he could do the same with Brexit. Nobody seriously expected leave to win.
Problem was, it turned out there was a lot of money in leaving the EU. It would make tax dodges easier for the ultra-rich, and it would allow disaster capitalists to make a killing by shorting the market. So money flowed into the leave campaign from wealthy donors hoping to make a killing. As a result, leave ran a much slicker campaign.
All this might not have been enough for leave to win, but people were also pissed off at the government for years of austerity policies and a flagging economy since the 2008 crash. Lots of people, saw the vote as a way to express their displeasure in the government. Some of those who voted leave never expected it to win.
SO yes, you're right. The referendum was poorly worded and poorly planned. This was evident in the immediate aftermath. The House of Commons could not agree at all on what to do. A large chunk still backed remaining, but not a majority. Lots of MPs decided that, even though they knew Brexit was a bad idea, their constituents had voted for it, so they needed to switch sides. They didn't all switch to the same side though. Some wanted a no-deal Brexit. Some wanted to remain in the customs union and single market. Others wanted different arrangements. There was no majority for any course of action, because the referendum didn't describe a course of action, and it paralyzed UK politics for years.