Elections and referenda are not decided by rational debate. Or at the very least, not exclusively. The idea that they are is really quite naive. They're way more complicated. I can't think of any public vote in my lifetime where the debate could reasonably be described as 'rational'. And no, that's not a reason to do away with democracy. Democracy is still the best available system to hold power accountable and reduce corruption.
In a contest where the voting public was so evenly split, it's pretty much indisputable that day was won in the short-term by campaigning.
As I said earlier, campaigning is not magic. The AV referendum, for example, was pretty much a doomed cause in hindsight because the overwhelming majority were either not interested or actively opposed. Brexit wasn't like that - it split the country down the middle and the deciding votes were cast by people who went into the debate undecided.
This is not a criticism of Brexit. Lord knows I have plenty of them, which I have expressed plenty of times on here, but this ain't one. The Remain campaign was complacent and badly run, not to mention tone deaf as to why its messages weren't sticking. Vote Leave were smarter than that.