As continental Europeans are want to do, the moment the EU came into being, they loaded it with a bloated, expensive and unnecessary bureaucracy, just like in most of the member states that make it up. Denmark almost gave up its membership within a week of joining when the EU bureaucracy declared that Danish apples were too small to conform to what their rules said could be called apples. The Danes were told they would have to call their apples something else. The Danes said that if THIS is what EU membership meant, then they weren't interested after all. The EU quickly relented, and "graciously" let the Danes call their apples "apples."
France insisted that the EU parliament not be headquartered only in Brussels. They wanted part of the pie (i.e. billions in costs charged to the EU). So a huge EU parliament building now stands in Strasbourg, France, some 400 KM from Brussels. Once a month, the whole paperwork is loaded onto a convoy of trucks, and brought for a week from Brussels to Strasbourg. At taxpayer cost, the whole EU parliament travels there, stays in expensive hotels and eats at the great restaurants there--at EU taxpayer cost. This was featured prominently in the pro-Brexit TV ads before the first referendum. It cost UK taxpayers alone tens of millions of pounds (a month or a year, I forget, but it was insane) just for their share of these costs. The UK was working feverishly for reforms within the EU, but they were swimming against the tide. Bureaucrats DO love their perks, after all, and the EU has no shortage of them.
In the bigger picture, of course Brexit is a loser for the UK (and the EU). But the Brexiteers played on people's emotions, and figured, correctly, that enough voters in the UK would see how obvious a bad move it would be to leave, and not bother to vote. "How stupid do they think we are, after all?" Well, now they know. As we saw in the USA less than half a year later, such stupidity is not limited to the far side of the Atlantic.