I think a lot of people were aware of the consequences, that is why it was such a close vote. To be fair, the EU has had it's fair share of screw ups - Greece and the current immigration crisis are far from solved.
The trouble is when you are doing so well as a country, a lot of people want to move in. This is fine for a little while, but a constant inward migration will cause a lot of problems - traffic, lack of housing, public services struggling to cope. You could say this is unfair to the generations that have lived there before.
Freedom of movement can only work when the outer layer is strictly controlled and everywhere within has equalized so there is no strain on one area. There is a finite amount of land and shared resources, when you start to abuse or overuse them it can quickly drag society down.
When you hear stories of massive upheaval of European MP's travelling between Brussels and Strasbourg each year, it is really disconcerting that EU MP's are getting free reign to waste away people's money and are basically unaccountable.