You have to remember that the EU was created in the aftermath of World War 2. It was built to eliminate war amongst a group of countries that had warring for hundreds of years. Making it easy to leave would undermine that.
There is a procedure for leaving of course, as pointed out in other comments; that's what the UK made use of. There's no reason disentangling economies and legal frameworks that have been consolidating for more than half a century would be easy though.