EU membership was consistently not in the top 3 concerns of the UK public. We l8ve in a parliamentary democracy, if it became so important to people they could have voted for a party offering it (UKip). Germany in the 1930s is proof plebiscite referenda are not a good idea.
To have one about a subject this complex was insane. To have one not requiring a super majority even more insane. And to have one that didn't require unanimity between the constituent countries was asking for the break up of the UK.
And then there's the lies, the illegal harvesting of voter data, the illegal spending, and the influence of Russia to consider. The outcome was inevitably fucked.