Dieselgate essentially happened due to the interaction of the EU and US emission standards. EU emission standard got lowered until it wasn't physically possible, without reducing the machine power, which the market doesn't want. Thus, they introduced test mode, which does have the emissions actually allowed, but is worse in all other aspects. This worked in the EU, because the tests environment is defined and no other tests are performed.
The US regulators wouldn't have cared about higher emission levels as all cars in the US have them anyway, but the cars were still introduced with the EU specs. First because otherwise they would need to remeasure all the car emissions and second, because even as the real emissions would still be low by US standards that would have questions why the same car has different emissions in EU and US. That plan however didn't work out, as the US doesn't do tests in a controlled environment, but while actually driving. Thus, the scandal started becoming public. That is the official part.
The following comes from an "industrial expert", that held a guest lecture at our university: This whole thing was actually done with knowledge (and silent agreement) of the EU regulators, as they aren't dumb and know what is physically possible. However they were still forced to act once this became public in the US, as the politicians and the general voter don't like regulators doing there own thing against the law. Also this was done by a VW supplier, which is basically the only shop in town, so of course this wasn't specific to VW.
So in my opinion, blaming VW, while legally correct, is actually kind of dumb. At last a bit anecdotal evidence: We also did the update for our car. Of course we tried to delay it, but eventually the car would have lost it's street legality, so we needed to do it. And afterwards the car is louder, has visible emissions and smells (more). (No, this isn't even a car from VW or any other company of the same business group.) Thanks. Sometimes the best option would have been to just keep quite and stick to gentlemen agreements.