In the end, the best summary of the Greek crisis was given by Evangelos Venizelos, the Greek finance minister:
I can no longer look at polls where the majority is against the agreement, the majority is against the program, but a majority is also in favor of staying in the euro.
Greece (and the Eurozone more generally) is poised between two deeply unpleasant choices: accepting the deal, which won't solve the debt crisis and will lead to more punishing and deeply unpopular austerity measures; or refusing the deal and starting on the path of default, decouple and devalue
. Neither are pretty. Neither are remotely desirable. But one of them must be done.
What the referendum is, essentially, is a requirement that the Greek people act like adults and take a bit of responsibility for the future of their own country. I don't imagine that this will be terribly popular.