First, I would like to put into doubt concepts like "punish the UK" or "not listening to detractors", which are presented as facts by the OP.
So far, the position of the EU is that it wants a fast exit of the UK and that the position of the UK after the leave will have to be negotiated and will not be dictated by the UK wishes. The former helps shorten the uncertainty and make a faster the return to normality (and at the same time, preventing the UK from trying to bargain -again- for keeping membership of the EU in exchange of forcing the UK model on the EU). The latter is international politics as usual; treaties are negotiated to the convenience of both parties and not only of one of them (unless one of them has a really big stick).
So much to "punish the UK" motto, I think the EU is better explained as self-interest, in order to help to prevent further breakups.
And for "listening to critics", this is not what has happened here, either1. It was an issue of a country trying to redefine a treaty that such a country entered freely. And while the UK is free to decide that such a treaty is no longer profitable to it and to wish to renegotiate it, also the rest of the EU is free to reject such changes and say "take it or leave". Cameron 2 did think that he could score a political goal by forcing the EU to give yet more of an special treatment to the UK with his threats of leaving the EU3. He was wrong, but of course at the end he had others to blame for his mistakes.
The European Union are 28 countries, each country represented by a democratic government that each few years must present a positive result to its people or face dismissal. This always has always put a lot of pressure in its governance (which laws are approved, how funds are divided, etc). If every country gets to redefine, under threat of leaving it, what the EU treaties are and which ones affect them and which ones do not affect, the EU would stop being anything meaningful in a few years.
Since the EU has offered all what they are willing to offer, and the UK public has rejected such a deal, a breakup as fast as possible is the best possible outcome. As you said, the EU is a democracy and that would make it absurd for a single country to dictate terms of what the EU should be just because that country acts in such a stubborn way. Note that freedom of movements is one of the core tenets of the EU from its principle, it is not a recently added change.
Could the EU be better? As everything in this life, yes it could. But the need to coordinate the interests of 28 countries4 makes changes neither easy nor fast (at least, not fast enough to get Cameron elected, and that was his main stake). The "do it my way or I leave" is a very clumsy negotiating tactic that is not very appropriate for such complex issues.
1 Did any supporter of Brexit claim for the need of a change in the way the European Commission or the European Parliament work? I did not hear many constructive critics during this campaign, just requests to alter UK relationships with the EU.
2 Note that I am singling Cameron and neither the whole of the UK, nor the whole of the voter nor even the whole of Brexit supporters.
3 In fact the EU did send a proposal to the UK to make it more amenable (the February points, here is the official document), and that gave more flexibility to the UK in themes sensible to them, but that was not enough to convince the UK public.
4 Obviously, Nazi Germany would not have needed to negotiate any changes it wished, and would have had it way easier. That does not stop stupid comparisons, though.