Everyone joined the EU willingly. The fact that they can leave whenever is further proof that the EU is not autocratic.
- They were formulated as an EU-directive in 2006 (which means every national parliament is forced to pass a law based on this directive)
- The corresponding German law was passed in 2008
- The law was declared unconstitutional in 2010 by the German Supreme court and in 2014 by the EU high court
- Of course the german parliament reintroduced slightly changed legislation in 2015
It basically the same thing that keeps happening within Germany, it seems like the institutions work equally well or badly.
Now what is a problem is that national politicians like to hide behind the EU. That's why you should always check who voted for these things in the council. Usually it's the same people (or at least parties) who later they the EU is forcing their hand.
Note it was not the ECJ which struck down the law first, they did it after the BGB did strike it down, partially because they did not want to get into a fight about who has primacy in decision making I believe (the BGB still claims to have the last word, changing this would be unconstitutional in Germany).
I don't think politicians "hiding behind the EU" is what is actually happening, what actually happens is collusion to shift away power from the people by obfuscation and misdirection. People like Schäuble have active contempt for democracy (According to Varoufakis he told him "Elections can't change economic policy"). See for example this discussion of ECB policies (https://www.yanisvaroufakis.eu/2017/03/14/19258/).
I truly believe the EU has to go, in order for Europe to not further slide into a corporatist neo-liberal nightmare. It is very unfortunate that this push is lead by right-wing nationalists.