A lot of people are having real trouble understanding this whole democracy thing. Yes, it does involve bastards and racists and wankers and morons voting. And that is a Good Thing. Because it's their country too, so they should have a say. There is only one alternative: first, choose an elite, then have that elite define the group they don't wish to listen to, then ensure that that group have no say — either by outright denying them the vote, or (as the EU did) by designing a system that gives them a vote but ensures that vote has no power. That latter option, seductively tempting though it be, has a huge bloody great downside: it always leads to the disenfranchised group hitting back, hard. Always. And that's what happened this week. You'd think the elitists might learn from experience, but no. History is littered with this error.
I for one am grateful that the hitting back was achieved via a referendum and not a violent insurrection. I'm not confident the same will be the case in all the EU.