But they should not be surprised, because the public debate was stacked in favor of Brexit. Most importantly, the Brexit campaign played on public resentment of a political system that failed to address the implications of the 2007-2008 financial crisis and presided over increasing economic inequality.
The continuing ramifications of that crisis are the causes of economic concerns for the majority of the public: slow or no growth in incomes; fewer permanent full-time jobs and the growth of temporary jobs or precarious self-employment; high house prices and pressure on public services.
When people feel that economically they are doing badly they want somebody to blame; it was easy for the Brexit campaign to encourage the disenchanted to blame immigration and the EU. Most major newspapers are and always have been anti-EU so the Brexit side had widespread media support.
The major news media, the BBC and ITV, were stifled by the need to appear balanced so the information they provided was insufficient to help the public make an informed decision because it did not help people to choose between the alternative arguments.
Politicians who supported remaining in the EU failed to present a positive argument for the benefits of the EU and relied on the "fear argument" that Brexit would be economically very costly. This was not a potent strategy because these politicians were already discredited in the eyes of the public as responsible for the current economic concerns.
The disenchanted public were not convinced by institutions that predicted large costs resulting from Brexit or by foreign or local politicians arguing to remain because all were seen as part of the establishment complicit in the financial crisis and growing economic inequality.
This was perhaps the reason why politicians for "Remain" never corrected the claims (often no more than insinuation) that the EU was responsible. The EU was not the cause of the financial crisis or of economic inequality, but nobody made that argument publicly.
This is the most important lesson for EU states facing pressures for a referendum in their own country (and may also have lessons for the United States).
If voters are well-informed, a sensible debate based on evidence is feasible. When a large proportion of voters are not well-informed but are disenchanted and angry with politicians, opportunists can exploit their emotions.
European politicians need to recognize the major problems with the EU now and begin to address them; they need to relax the approach of binding rules and treaties and create a more flexible EU politics. They also need to inform the electorate about what it is reasonable to blame the EU or Euro for, and what arises from external challenges and events that Europe needs to stand together to address.
It is too late for the UK to do this, so the public now must wait and see, some in hope but others in trepidation. Things will not change immediately, and even the extreme economic volatility will subside.
Over the short-term, the issue in the UK is who will preside over the exit negotiations, how will Parliament function given the deep divisions in both the Conservative and Labour parties, and what will happen for Scotland and Northern Ireland (who both voted to remain)? An early general election is unlikely to be helpful because one cannot expect a decisive result. The words "forgive them for they know not what they do" come to mind.